JavaScript-How does a Web site store images that involve user-critical privacy more appropriate?

Source: Internet
Author: User
Keywords Php javascript java back-end development
Tags file url
How to store pictures such as ID card, more appropriate?

Images can only be accessed by users themselves and the background of the site, and other users cannot access them (other users will not be able to access the image even if they have src with image img).

is the local space estimate insufficient and the third party reliable? What are the proven solutions?

Reply content:

How to store pictures such as ID card, more appropriate?

Images can only be accessed by users themselves and the background of the site, and other users cannot access them (other users will not be able to access the image even if they have src with image img).

is the local space estimate insufficient and the third party reliable? What are the proven solutions?

has been solved, looked at the Upyun interface, found can use token anti-theft chain way.

Because accessing the IMG in this way requires the _upt parameter to be taken.

So we need to do before the user is really able to access the picture mybucket.upaiyun.com//target.jpg

    1. Determine whether the currently logged-on user has permission to access /target.jpg

    2. Have access, then generate the _upt parameter (the _upt parameter is based on the private token, restricted in the next few minutes to be accessed ETime, and the file URL, the 3 parameters generated)

    3. Append this _upt to the image URL to get mybucket.upaiyun.com/ /target.jpg?_upt=xxxxxxx

So that users can access to the picture, the user every time access to the picture must obtain the _upt parameter, and _upt's acquisition must pass through our own server authentication, and _upt is time-sensitive, more than we specified the user must re-obtain _upt.

Upyun's documentation

See if there is a scheme to generate tokens based on AK + SK + timestamp (use generated tokens to access resources within the validity period).

1. Save the name of the picture do not have a regular follow-up.
For example, you can md5 the time of the current upload image plus the n-bit random number, the generated value is used to do the image name.
2. Images can be placed on a third-party CDN
For example, seven cows, Ucloud, speed and service is more reliable.

You said the situation should be symmetric encryption of picture files, such as using AES, and a key generated for each user in a particular way. Because pictures should not be used frequently, when used in a temporary decryption can be

Now file storage, to mature service providers (such as seven cows, etc.) to deal with more convenient, safe and what they have done for you, you just need to put the file on the host, and then record the three-party service returned information (image chain and some other information) can be. With regard to access rights, you need to make your own judgment in the logic layer of the program.

  • 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.