﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32413	File upload permission denied error on large files	James Miller	nobody	"Hi, if an uploaded file exceeds the DATA_UPLOAD_MAX_MEMORY_SIZE of 2.5 mb, django starts streaming the file data to a file in /tmp.

When finished it copies it over to the its required file path location, but despite the permissions being set correctly,  a permission denied error occurs.

{{{
Request Method: 	POST
Request URL: 	http://127.0.0.1:8000/xxxx/upload/
Django Version: 	3.1.5
Exception Type: 	PermissionError
Exception Value: 	

[Errno 13] Permission denied: '/opt/django_forum/django_forum/media/uploads/users/xxxxx/Albert_Memorial_London_-_May_2008_vWcDQT6.jpg'

Exception Location: 	/usr/local/lib/python3.9/shutil.py, line 329, in _copyxattr
Python Executable: 	/usr/local/bin/python
Python Version: 	3.9.1
Python Path: 	

['/opt/django_forum/django_forum',
 '/opt/django_forum/django_forum',
 '/etc/opt/django_forum',
 '/opt/django_forum',
 '/usr/local/lib/python39.zip',
 '/usr/local/lib/python3.9',
 '/usr/local/lib/python3.9/lib-dynload',
 '/usr/local/lib/python3.9/site-packages']
}}}

I have tried setting the following settings:

{{{
FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
FILE_UPLOAD_PERMISSIONS = 0o644
}}}
Most disturbingly, the large files are created in their final position with 0755 permissions.

I am using a containerised workflow as opposed to a venv but I am not certain that that should cause any issues."	Uncategorized	new	Uncategorized	3.1	Normal				Unreviewed	0	0	0	0	0	0
