#26562: Introduce Storage and FileSystemStorage alternate save behaviour
-------------------------------------+-------------------------------------
Reporter: freshquiz | Owner: nobody
Type: New feature | Status: new
Component: File | Version: master
uploads/storage |
Severity: Normal | Resolution:
Keywords: file FileField | Triage Stage: Accepted
storage overwrite filepath |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by freshquiz):
Replying to [comment:13 timgraham]:
> My concern about file clobbering was related to Aymeric suggesting
making a backwards-incompatible change in comment:4 (again, maybe I mis
understood the ramifications of his proposal).
I see...
> Anyway, I don't mind looking a patch that might make the use case
easier. In the interim, it looks like [https://github.com/un1t/django-
cleanup django-cleanup] might fit your needs.
That doesn't fit my needs unfortunately, because my use case warrants the
preservation of the original end-user specified file name, i.e. the
current file name mangling (to avoid overwrite) is undesirable.
Sorry, I forgot to mention this directly, even though I repeatedly said
that the current implementation does not ensure the client-dev has total
control over the final path/key.
So I guess for me it's two problems:
* Not having total control over the storage path/key
* Not being able to overwrite files
...where the latter is caused by the former.
I have a workaround (albeit I'm still finishing it off), which will also
take into account the fact that there is no `post_save()` method on model
`Field` sub-classes (meaning that files get saved into storage potentially
before a database save is about to fail; another undesirable trait of the
current implementation, to me), but it does not take into consideration
backwards compatibility (otherwise I would have submitted a patch as well
as the ticket).
--
Ticket URL: <https://code.djangoproject.com/ticket/26562#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.bfab84a9ab4a8b96507501bb1f78a365%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.