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.