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

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

WBOY
Release: 2016-06-20 13:02:28
Original
1581 people have browsed it

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

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

 


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template