Right now, uploading a file to overwrite an existing one will use the standard Django behaviour of keeping the old file in place, and adding characters to the end of the new file if the file names match. This is sensible behaviour; in particular, it enables easy versioning.
Oft-requested, though, is the ability to overwrite an existing file so that the URL does not change. I think there are other ways of doing the same thing, but better (using the permalinks system, using redirect shortlinks, etc) that do not break the ability to undo via reversion. Still, that gets requested, and I don't see that it's a bad idea all of the time.
Some things to consider in the solution:
Are there any places in which there is an assumption, implicit or otherwise, that a file with a given path is immutable? I am thinking that thumbnail caches might not get invalidated, for one.
Should you guard against files of different types being overwritten with files of other types? E.g. someone tries to overwrite a PNG on top of a JPEG - we obviously wouldn't want that to happen most of the time. But then there is the use case where the overwrite functionality could reasonably used to correct a previous mistaken file type upload. (Is clean_file in media.forms.FileForm reliable enough to rule out this ever being needed?)
Should this be broken out into a separate "overwrite file" form?
Right now, uploading a file to overwrite an existing one will use the standard Django behaviour of keeping the old file in place, and adding characters to the end of the new file if the file names match. This is sensible behaviour; in particular, it enables easy versioning.
Oft-requested, though, is the ability to overwrite an existing file so that the URL does not change. I think there are other ways of doing the same thing, but better (using the permalinks system, using redirect shortlinks, etc) that do not break the ability to undo via reversion. Still, that gets requested, and I don't see that it's a bad idea all of the time.
Some things to consider in the solution:
clean_file
inmedia.forms.FileForm
reliable enough to rule out this ever being needed?)