Filepond: Stale files when replacing an already-uploaded temporary file

Created on 28 May 2018  路  6Comments  路  Source: pqina/filepond

First of all, FilePond is very awesome and slick, superb job!

Anyhow, I'll go right to the point. Lets say you have a FilePond instance which allows only 1 file. You drag-and-drop the file and it is immediatly uploaded as a tmp file on the server. Now you realised that its the wrong file, the natural behaviour would be to just drag another file over that one, FilePond behaves accordingly: it removes the previous one and replaces it with the newly-dragged one.

But when the user does so, no revert method is called for the previous file. This means that the server will have a lot of stale files!

It would be great, if the revert method is called in this case so that the server can clean the tmp directory!

Kind regards,
Denis

All 6 comments

Hi @enisdenjo, Thanks for giving FilePond a go!

Good point, it should call revert, I've added it to my todo list.

About the temp files. I think it's wise to set up a server script that periodically clears the temp upload folder ( for instance of files older than a day ) as users could also simply close the browser window.

Hey @rikschennink,

thanks for the quick reply! Of course we'll have a cleanup method which removes stale temporary files. The reason behind the issue is that our use case is that EVERY uploaded file will come with a payload which will hold all relevant information for processing the said file. In this case we need to be carefull in what we delete from the tmp file, and this feature would help a lot!

@enisdenjo Aha, got it! :-)

Just published version 1.5.4 which should fix the issue.

Amazing, I can confirm that it works! 馃槃

Thanks for confirming 馃憤

@enisdenjo Just uploaded version 1.6.2, found an issue with restored temporary files not being removed when replaced. Should be good now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oldrich-s picture oldrich-s  路  5Comments

juongithub picture juongithub  路  7Comments

Strenget picture Strenget  路  6Comments

madrussa picture madrussa  路  6Comments

vvtkachenko picture vvtkachenko  路  7Comments