bartTC / django-attachments

A generic Django application to attach Files (Attachments) to any model.
BSD 3-Clause "New" or "Revised" License
296 stars 90 forks source link

Instead of renaming attachments with same name, store them in subdirectories #107

Open lmoellendorf opened 1 year ago

lmoellendorf commented 1 year ago

This is related to kiwitcms/Kiwi#3104

This isas feature request to solve this problem:

If a file is uploaded multiple times, it gets renamed. So if a user downloads the file it has not the intended name and must be renamed.

In our use case the file name is specific and must not be changed in order to be usable by the user.

This is the proposed solution:

Instead of renaming the file, store it in a subdirectory. This will create a unique path without changing the file name.