What should I do if the garbage uploaded during Content Publishing is appropriate?

Source: Internet
Author: User
How can I handle the garbage uploaded during content publishing? When we upload images and other files through the editor during content publishing, we may find that the files are uploaded incorrectly or temporarily unavailable, but the files have already been uploaded, it is not used up, that is, it becomes a junk file. of course, when I am working on a program, I have recorded the uploaded file information, including the name and address, in the data table, my idea is to regularly clean up files without a bound Content ID. What other solutions do you have? ------ How can I handle the garbage uploaded when the solution publishes the content?
When we upload images and other files through the editor during content publishing, we may find that the files are uploaded incorrectly or temporarily unavailable, but the files have already been uploaded, it is not used up, that is, it becomes a junk file. of course, when I am working on a program, I have recorded the uploaded file information, including the name and address, in the data table, my idea is to regularly clean up files without a bound Content ID. What other solutions do you have?

------ Solution --------------------
It depends on how you save the relevant information.
It would be much easier if there is a "use" or "apply" field.
Did you say yes?
------ Solution --------------------
Blog writing like cnblog will be automatically saved at regular intervals. at least the first time ajax will be automatically saved and submitted to the database to record the ID of this blog post,
AJAX will return an Article id appended to the form. The next ajax request or an active submission will show which article the attachment belongs to. that is to say, once an attachment is submitted, this blog post is a draft of the Author. you can see it in the draft box. Even if the browser closes JS, there will naturally be no automatic storage, and there will be no attachment Upload function. there is only one normal submit button, which is stable and degraded.

That is, I think the premise for uploading any attachment is that this article has been written into the database, and all attachments belong to this article ID.

If your application just needs to upload an attachment separately, it may be difficult for the server to program and record who the attachment belongs.
Unless the uploaded attachments are stored in the database or written into the file system, the path is recorded in the SESSION, and the final Association is established when a blog post is actually submitted, it is indeed necessary to regularly clean up the unassociated attachments, whether they are recorded in the database or the file system.

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.