Question

I am using jQuery File Upload plugin by blueimp and everything works fine. But I've just realized that if users upload files and navigate away from the page without completing the form, it will create "orphan" files.

Is there a way to delete files onbeforeunload?

Was it helpful?

Solution

There is, but its not guaranteed to work 100% of the time.

To make sure temp files don't pile up you have to implement some sort of 'garbage collection'. You can do it in a cron job, or with a certain probability on every upload request.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top