By default, it seems the files uploaded in the course of a mod_http_upload file transfer remain stored and available without any time limit. Just as a maximum file size option is available for the administrator to configure, it would be nice to let the administrator choose how long the files uploaded remain stored on the server.
- A tentative name for the option could be: http_upload_file_storage_duration
- It would be nice to be able to provide a value in hours, days, weeks or months (eg: 3h, 5d, 6w, 2m)
- It might be necessary to also have an "off"/"unlimited" value for those who want to store files without any time limit.
- I don't know if this is possible in the scope of this request, but it could be useful for some to have an option to delete files as soon as they have been downloaded once
- There should be a sensible default value. My vote would go for 7 days, but there are probably good arguments for shorter, longer or unlimited duration that I am not thinking about.
Many thanks for all your work on Prosody and for reviewing this request.
In the mean time, this can be added to crontab to remove files after 7 days:
@daily find /var/lib/prosody/http_upload -type f -mtime +7 -delete; find /var/lib/prosody/http_upload -mindepth 1 -type d -empty -delete
My next step after posting this was to review if I could do that with cron, so thank you very much for sparing me the search :)