Website picture upload can realize the second pass function?

Source: Internet
Author: User
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

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.