Opened 6 years ago

Closed 6 years ago

#29537 closed Bug (duplicate)

Uploaded big files (>2621440 B) not readable by the server

Reported by: fp4code Owned by: nobody
Component: File uploads/storage Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There is a non-coherent uploading treatment between small and big files,
this can be problematic if different users are involved for main and django servers
(eg www-data for nginx and mysite for uwsgi processes).

If the file is small, the MemoryFileUploadHandler is used, file is 0o644, readable by the server.

If the file is big, the TemporaryFileUploadHandler is used, files are uploaded 0o600 in /tmp,
and moved by file_move_safe which keeps attributes. Hence the file is not readable by the www-data server.

A workaround is to define FILE_UPLOAD_PERMISSIONS=0o644,
but it should be good to have a coherent behavior,
taking into account that discovering this configuration anomaly is not immediate.


Change History (1)

comment:1 by Tim Graham, 6 years ago

Component: Core (Other)File uploads/storage
Resolution: duplicate
Status: newclosed

Looks like a duplicate of #28540.

Note: See TracTickets for help on using tickets.
Back to Top