Q: What is the usage rate of images uploaded by users on the website?

Source: Internet
Author: User
Tags delete key
If a thumbnail of an article with images is published, it will be saved on the server and the image URL will be saved in the image field of the article table, and the image url will be saved in the attachment table. mark as being used when the user is publishing an article with an image. Upload an image. If a thumbnail of an article with an image is published, it will be saved on the server.
The URL is saved in the image field of the article table.

In addition, the image url will save a mark in the attachment table, which is in use

When you publish an article with images. I have uploaded an image, but I do not want it to be deleted.

When you click Delete imageThe image is stored in the attachment table.Mark not needed

In this way, the background scans once. If the image is not in use, delete it physically and remove it from the attachment table.

Is that how you clean up useless images?

Another problem is thatOnline EditorIf the image is uploaded, the editor is inserted directly.Press the delete key.I don't know how to delete it.

Reply content:

If a thumbnail of an article with images is published, it will be saved on the server.
The URL is saved in the image field of the article table.

In addition, the image url will save a mark in the attachment table, which is in use

When you publish an article with images. I have uploaded an image, but I do not want it to be deleted.

When you click Delete imageThe image is stored in the attachment table.Mark not needed

In this way, the background scans once. If the image is not in use, delete it physically and remove it from the attachment table.

Is that how you clean up useless images?

Another problem is thatOnline EditorIf the image is uploaded, the editor is inserted directly.Press the delete key.I don't know how to delete it.

When deleting an article, you can directly delete the file without waiting for regular processing.
When editing an article and updating a table, check the number of images in the regular expression (find the text pattern of the inserted image in your editor, whether it is img or markdown), and compare it with the attachment table, 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.