filebrowser-safe file permissions

300 views
Skip to first unread message

Josh Cartmell

unread,
May 30, 2013, 5:04:27 PM5/30/13
to mezzani...@googlegroups.com
I just noticed that if a file is over a certain size (not exactly sure what the size is but somewhere around 3-4MB) the permissions after uploading through filebrowser-safe are -rw------- which results in 403 forbidden errors (at least in my case).  If the file is smaller than that size the permissions are -rwxr-xr-x which seems correct.  Is anyone else having this issue and are there any workarounds?

Stephen McDonald

unread,
May 30, 2013, 5:08:37 PM5/30/13
to mezzani...@googlegroups.com
Not sure, but could be related to FILE_UPLOAD_MAX_MEMORY_SIZE (and possibly FILE_UPLOAD_PERMISSIONS)

On Fri, May 31, 2013 at 7:04 AM, Josh Cartmell <joshc...@gmail.com> wrote:
I just noticed that if a file is over a certain size (not exactly sure what the size is but somewhere around 3-4MB) the permissions after uploading through filebrowser-safe are -rw------- which results in 403 forbidden errors (at least in my case).  If the file is smaller than that size the permissions are -rwxr-xr-x which seems correct.  Is anyone else having this issue and are there any workarounds?

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Stephen McDonald
http://jupo.org

Josh Cartmell

unread,
May 30, 2013, 5:15:43 PM5/30/13
to mezzani...@googlegroups.com
Thanks for the pointers Steve.

I set:
FILE_UPLOAD_PERMISSIONS = 0644
which fixed the problem.

I think the problem was a combination of not having FILE_UPLOAD_PERMISSIONS set and the size of FILE_UPLOAD_MAX_MEMORY_SIZE.  The docs say, "On most platforms, temporary files will have a mode of 0600, and files saved from memory will be saved using the system’s standard umask."  I read that as saying that if your file is greater than FILE_UPLOAD_MAX_MEMORY_SIZE adn FILE_UPLOAD_PERMISSIONS is none the permissions are set to 600.

Josh Cartmell

unread,
Jun 20, 2013, 1:39:37 PM6/20/13
to Mezzanine Users
This got me again today, do you think FILE_UPLOAD_PERMISSIONS = 0644
should be in the default settings.py?

On May 30, 2:15 pm, Josh Cartmell <joshcar...@gmail.com> wrote:
> Thanks for the pointers Steve.
>
> I set:
> FILE_UPLOAD_PERMISSIONS = 0644
> which fixed the problem.
>
> I think the problem was a combination of not having FILE_UPLOAD_PERMISSIONS
> set and the size of FILE_UPLOAD_MAX_MEMORY_SIZE.  The docs say, "On most
> platforms, temporary files will have a mode of 0600, and files saved from
> memory will be saved using the system’s standard umask."  I read that as
> saying that if your file is greater than FILE_UPLOAD_MAX_MEMORY_SIZE adn
> FILE_UPLOAD_PERMISSIONS is none the permissions are set to 600.
>
>
>
>
>
>
>
> On Thu, May 30, 2013 at 2:08 PM, Stephen McDonald <st...@jupo.org> wrote:
> > Not sure, but could be related to FILE_UPLOAD_MAX_MEMORY_SIZE (and
> > possibly FILE_UPLOAD_PERMISSIONS)
>
> >https://docs.djangoproject.com/en/dev/ref/settings/#file-upload-max-m...
>
> > On Fri, May 31, 2013 at 7:04 AM, Josh Cartmell <joshcar...@gmail.com>wrote:
>
> >> I just noticed that if a file is over a certain size (not exactly sure
> >> what the size is but somewhere around 3-4MB) the permissions after
> >> uploading through filebrowser-safe are -rw------- which results in 403
> >> forbidden errors (at least in my case).  If the file is smaller than that
> >> size the permissions are -rwxr-xr-x which seems correct.  Is anyone else
> >> having this issue and are there any workarounds?
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Mezzanine Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to mezzanine-use...@googlegroups.com.
> >> For more options, visithttps://groups.google.com/groups/opt_out.

Stephen McDonald

unread,
Jun 21, 2013, 4:13:37 AM6/21/13
to mezzani...@googlegroups.com

Josh Cartmell

unread,
Jun 21, 2013, 12:51:18 PM6/21/13
to mezzani...@googlegroups.com
Thanks Steve!
Reply all
Reply to author
Forward
0 new messages