3

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?

  1. 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?

See my full issue here

Yotam Omer
  • 15,310
  • 11
  • 62
  • 65
Francis Yaconiello
  • 10,829
  • 2
  • 35
  • 54

1 Answers1

0

They provide a solution here: https://github.com/sehmaschine/django-filebrowser/issues/40

Juan Riaza
  • 1,618
  • 2
  • 16
  • 35
  • that thread solves a different problem. at the very end of the thread you'll notice it links to another issue - mine. https://github.com/sehmaschine/django-filebrowser/issues/103 – Francis Yaconiello Jan 08 '13 at 13:16