I use django-filebrowser and django-storages (w/ s3boto) to add file embed into my tinyMCE implementations for my django projects.
Recently I noticed that there is a bug, django-fileborwser does not save thumbnailed versions of uploaded files properly when using an S3 as a backend.
I stepped through the version creation function (in django-filebrowser), and found what I think to be the bug.
fp is at EOF. Use rewind option or seek() to data start.
which occurs because
# Rewing the file pointer back to 0, before saving to the storage object
tmpfile.seek(0)
isn't called before
# Existing Code
site.storage.save(version_path, tmpfile)
I reported the bug through the issue tracker with my suggested fix. Then the repo's author threw me for a loop and asked:
@fyaconiello shouldn´t that snippet be part of the s3-storage engine (with django-storages) instaed of adding it to the filebrowser?
- I guess the file rewind could be done in either library. But which library does it belong in?
- Should django-storages make sure all tmpfile pointers are rewound?
- is it django-filebrowser's job as it is the implimentor?