root-gg / plik

Plik is a temporary file upload system (Wetransfer like) in Go.
https://plik.root.gg
Other
1.47k stars 168 forks source link

Reset upload TTL on file download #425

Closed droplinxuser closed 2 years ago

droplinxuser commented 2 years ago

Like: Files will be kept on the server indefinitely as long as they are downloaded at least once every 1 month. Auto delete for inactive files.

Thanks!

camathieu commented 2 years ago

Hello @droplinxuser.

It's the exact purpose of Plik. By default files are kept for 1 month but it's customizable.

droplinxuser commented 2 years ago

So for example:

Scenario 1: File uploaded on April 1, but no one downloaded that file so on May 1 it will be automatically deleted on the server.

Scenario 2: File uploaded on April 1, and it gets downloaded at-least once a day so it will be available on the server forever as long as it gets downloaded once a month?

camathieu commented 2 years ago

Unfortunately this is not supported yet, the expiration date is computed only when the upload is created.

On the other hand it should be relatively easy to implement. We just need to update the expiry date again each time the file is downloaded. We could also add a file download counter for later statistics like trending files. That would fit for 1.3.6 milestone.

On Thu, 7 Apr 2022, 22:31 droplinxuser, @.***> wrote:

So for example:

Scenario 1: File uploaded on April 1, but no one downloaded that file so on May 1 it will be automatically deleted on the server.

Scenario 2: File uploaded on April 1, and it gets downloaded at-least once a day so it will be available on the server forever as long as it gets downloaded once a month?

— Reply to this email directly, view it on GitHub https://github.com/root-gg/plik/issues/425#issuecomment-1092173356, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQ5XPVYRAN3ZKOXSOYX6DLVD5AZDANCNFSM5S2KYYOA . You are receiving this because you commented.Message ID: @.***>

droplinxuser commented 2 years ago

Nice update, this is it right? New features SetTTL and ExtendTTL

camathieu commented 2 years ago

Indeed, I'll close the issue once 1.3.6 is released

camathieu commented 2 years ago

Released in https://github.com/root-gg/plik/releases/tag/1.3.6