XF 2.1 Which cron job is intended to remove cancelled upload attachment files?

Kevin

Well-known member
When a file attachment to a post is cancelled the attachments/upload process continues and the file gets saved physically to the /data/attachments folder.

What cron is intended to be the one that would remove these kinds of orphaned files?
 
It's the Hourly clean up cron task.

XF\Cron\CleanUp::runHourlyCleanUp()

I believe it deleted unassociated attachments after 24 hours.
Thanks. :) It may be the "after 24 hours" part that is throwing me off, I was kind of expecting it to be from the last run. I'll experiment again tomorrow.
 
Last edited:
Thanks. :) It may be the "after 24 hours" part that is throwing me off, I was kind of expecting it to be from the last run. I'll experiment again tomorrow.
You need some sort of threshold. Like if I upload something now and spent 15 minute writing the rest of the post (the post doesn't exist until I submit it), the attachment is "unassociated" for that 15 minutes even though the end result is a valid attachment on a valid post. So what if I took a REALLY long time like 2 hours to write a post? Don't want the attachments getting deleted before I submit the post.
 
Top Bottom