For example, 360 cloud disk and other network disk, sometimes in the upload of files will have "seconds" effect, a search, this principle is each file has its own independent hash value and MD5 value, so you can at the time of uploading to determine whether the file in the server has existed, so to achieve the function of the second pass.
Then our PHP site can also achieve such a function, I know in the customer service can not recognize the image of the MD5 but, as long as the space can be recognized so that increases the utilization of space Ah, so that many of the same images are repeated upload and save on the server.
Could it be achieved?
In addition to the picture, other documents also have a unique logo, you can also achieve such a bar.
Is it necessary to do so?
Reply content:
For example, 360 cloud disk and other network disk, sometimes in the upload of files will have "seconds" effect, a search, this principle is each file has its own independent hash value and MD5 value, so you can at the time of uploading to determine whether the file in the server has existed, so to achieve the function of the second pass.
Then our PHP site can also achieve such a function, I know in the customer service can not recognize the image of the MD5 but, as long as the space can be recognized so that increases the utilization of space Ah, so that many of the same images are repeated upload and save on the server.
Could it be achieved?
In addition to the picture, other documents also have a unique logo, you can also achieve such a bar.
Is it necessary to do so?
Of course it can be achieved. See my answer in this question.
and the local file MD5, you have to rely on browser and JavaScript, modern browser support FileReader, can read local files, and then use JavaScript to calculate the MD5 value of the file, and then the MD5 Value to the server side to determine whether the file has been uploaded before.
There is a better solution, the file name unified with the file itself MD5 salt generation, only with the comparison of file names can be! Rules can be set on their own