Login

Tag "file-storage"

Snippet List

Overwriting file storage

The title says it all — a subclass of FileSystemStorage which will overwrite files. Note that saves which fail part way though will leave the original file intact (see `test_upload_fails`). Based roughly on http://djangosnippets.org/snippets/2044/ .

  • file
  • storage
  • filestorage
  • file-storage
Read More

File storage with a better rename method

A file storage which uses a more sane rename method for existing files. Add `DEFAULT_FILE_STORAGE = 'site.storage.BetterNameFileSystemStorage'` (obviously changing `site.storage` to the module which you put this inside)

  • file-storage
Read More

3 snippets posted so far.