#557 mod_http_upload: add file storage expiry option

Reporter ageru
Owner Zash
Created
Updated
Stars ★★ (2)
Tags
  • Priority-Low
  • Status-Fixed
  • Type-Enhancement
  1. ageru on

    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.

  2. Zash on

    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

    Changes
    • owner Zash
    • tag Priority-Low
    • tag Status-Accepted
  3. ageru on

    Hi Zash, 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 :) Kind regards.

  4. Zash on

    This would probably be easier with #718

  5. Zash on

    Changes
    • tags Status-Started
  6. Zash on

    Fixed in https://hg.prosody.im/prosody-modules/rev/6daaa1ad2559

    Changes
    • tags Status-Fixed

New comment

Not published. Used for spam prevention and optional update notifications.