Opened 10 years ago

Closed 10 years ago

#23183 closed New feature (duplicate)

Use timestamp when uploading duplicate filenames

Reported by: Areski Belaid Owned by: nobody
Component: File uploads/storage Version: dev
Severity: Normal Keywords: upload
Cc: Areski Belaid Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When Uploading duplicate filenames, we use incremental method to determine the new filename, this method can slowly worsens over time if there is many files of the same name (ref https://code.djangoproject.com/ticket/23157) and it also give anyone informations about the files already uploaded.

This patch provide an easy way to obfuscated the names of the already uploaded files, which I think, may be the desired behavior we may want by default at some stage.
The global setting FILE_UPLOAD_USETIME_DUPLICATE try to remedy to this.


Change History (4)

comment:1 by Areski Belaid, 10 years ago

PR: https://github.com/django/django/pull/3018

This is a PoC, I will fix the tests if this is accepted.

comment:2 by Tim Graham, 10 years ago

I think adding a hash rather than a timestamp (or even an option to replace the filename with a hash) would be a better solution. Users may not want to leak the time a file was uploaded. Adding a new setting is usually a no go if there is a way to avoid it, but perhaps the setting could be transitional as you've noted. It would be good to discuss this ticket on the DevelopersMailingList.

comment:3 by Areski Belaid, 10 years ago

Thanks for the feedback, a suggested I opened a discussion here https://groups.google.com/forum/#!topic/django-developers/rjZbo4_W9jU

comment:4 by Tim Graham, 10 years ago

Resolution: duplicate
Status: newclosed

We will address this in the fix for #23157. I am working on a patch.

Note: See TracTickets for help on using tickets.
Back to Top