Ask a question about user upload image usage on the site

Source: Internet
Author: User
If someone publishes an article with a picture of the thumbnail image will be saved on the server at the same time the picture
The URL is saved in the Picture field in the article table

And the URL of the picture will also be saved in the attachment table a copy of the tag is in use

When the user publishes an article with pictures. Upload a picture, but do not want this picture and want to delete this picture

When you click Delete Image, you will Mark the image in the attachment table.

This time, the background scan once. If there is no picture in use, delete it physically and remove it from the attachment table.

Is that how you clean up the useless pictures?

Another problem is that if a user uploads a picture in an online editor , it's inserted directly into the editor. If the user presses the DELETE key to erase it, I don't know how he deleted it.

Reply content:

If someone publishes an article with a picture of the thumbnail image will be saved on the server at the same time the picture
The URL is saved in the Picture field in the article table

And the URL of the picture will also be saved in the attachment table a copy of the tag is in use

When the user publishes an article with pictures. Upload a picture, but do not want this picture and want to delete this picture

When you click Delete Image, you will Mark the image in the attachment table.

This time, the background scan once. If there is no picture in use, delete it physically and remove it from the attachment table.

Is that how you clean up the useless pictures?

Another problem is that if a user uploads a picture in an online editor , it's inserted directly into the editor. If the user presses the DELETE key to erase it, I don't know how he deleted it.

Deleting the article, delete the file directly, do not have to wait for regular processing.
When editing an article, when the Update table, the regular check the contents of the number of pictures (Find your editor to insert the text of the image rule, is an IMG or markdown), and the attachment table contrast, inconsistent deletion.

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