thegooglecodearchive / django-filebrowser

Automatically exported from code.google.com/p/django-filebrowser
Other
0 stars 0 forks source link

uploaded file permissions problem & fix #356

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using an older version filebrowser_safe-0.1.1 which was packaged with the 
mezzanine cms/blog package and Django 1.3.0

My issue was that after uploading files, I could not display them with my nginx 
static server (on Webfaction), I was getting 403 errors. 

I found the problem to be permissions of the files being uploaded. My fix was 
simple. Within the handle_file_upload function, after the file is saved (line 
277 of trunk, line 236 of my version), I added the line "os.chmod(uploadedfile, 
0755)"

I bring this up with the intention to be a resource to googlers and/or to 
propose that a setting be added which would allow  checking and setting minimum 
permissions of uploaded files.

I'm open to comments about my method including drawbacks, etc.

Original issue reported on code.google.com by JESyk...@gmail.com on 13 Jul 2011 at 7:22

GoogleCodeExporter commented 9 years ago
solved, see 
https://github.com/sehmaschine/django-filebrowser/commit/ef98f6bcef624715d95bc4d
d57a49d6acfea8c65

Original comment by sehmaschine on 19 Jul 2011 at 4:04