Tuesday, June 6, 2017

Re: Filefield uploads in django admin

On Tuesday 06 June 2017 08:59:06 Tim Graham wrote:

> The default behavior of FileSystemStorage is, "If a file with name

> already exists, an underscore plus a random 7 character alphanumeric

> string is appended to the filename before the extension." Do you want

> to always overwrite existing files if a file with that name already

> exists? That's a bit dangerous, but you can accomplish it by writing

> a custom storage.

 

Or you can use a callable to upload_to if you don't care about being storage backend (filesystem) agnostic.

 

--

Melvyn Sopacua

No comments:

Post a Comment