Home > Backend Development > PHP Tutorial > 能不能在文件上传到服务器之前,判断文件是否有重复

能不能在文件上传到服务器之前,判断文件是否有重复

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:29:32
Original
1475 people have browsed it

能不能在文件上传到服务器之前,判断文件是否重复?

回复内容:

能不能在文件上传到服务器之前,判断文件是否重复?

如果你是浏览器中上传,那需要借助 JavaScript 来获得本地文件的 md5 值,可以参考这个 StackOverFlow 回答。
如果你是普通的客户端,那就更好办了,总之是要拿到本地文件的 md5。

然后,服务器上,保存一个所有已经上传完成的文件的 md5 列表。在用户上传文件之前,先将本地文件的 md5 发送到服务器,服务器在已存文件的 md5 中查找,如果查到了,那就说明已经有了。

客户端没有完全判断的。

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template