iron/params

Delete temporary file upload directory after request is finished being handled

Closed this issue · 0 comments

multipart exposes functionality for deciding when to delete the uploaded files that have been temporarily saved to the local file system. Currently, params uses entires.dir.keep(), which leaves deletion up to the operating system. So, deletion is usually done on system restart (rare for web servers), after a certain amount of time, or when disk space is low. To have a more traceable footprint, params should delete the temporary files after the respective request has been processed.

Specifically, this could be done within the Plugin::eval implementation by inserting the temporary directory's handle into the request's type map.