Home  >  Article  >  Backend Development  >  php文件上传文件存放位置避免重复的方案-内容md5_file加密

php文件上传文件存放位置避免重复的方案-内容md5_file加密

WBOY
WBOYOriginal
2016-06-20 13:02:281516browse

在处理php文件上传中,为了使服务器上尽量减少重复文件占用空间,可以通过md5计算图片文件的内容加密作为图片文件的名称存储在服务器上,避免储存相同图片,减少服务器开销!

<?php $filename = "test.txt";
$md5file = md5_file($filename);
echo $md5file;
?>

 


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn