search

Home  >  Q&A  >  body text

php - How to clear the uploaded junk files when uploading files asynchronously?

How to clear the uploaded junk files when uploading files asynchronously?
How are the junk images uploaded by segmentfault processed? Can you tell us?

迷茫迷茫2778 days ago594

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:01:10

    Name the file with the article/topic as the prefix. Determine which pictures are used in the current article/topic, and then clean up other discarded pictures regularly. If there is enough space, keep them there~~~

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:01:10

    The image is uploaded to a temporary folder and moved to the correct folder after the operation is successful. Just clean the temporary folder regularly and write a scheduled task

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:01:10

    The steps are as follows,
    1 It is recommended to store the uploaded file in the form of /path/to/category/2017/08/09/xxx.ext;
    2 Then every time the operation is successful and the correct form is submitted, the corresponding file should be The attachment path and time information are recorded in the attachment table;
    3 Next, we can use SQL statements to clean up junk files that are not in the attachment table every day.
    No thanks.

    reply
    0
  • Cancelreply