Understanding FILE_UPLOAD_MAX_MEMORY_SIZE vs. DATA_UPLOAD_MAX_MEMORY_SIZE

211 views
Skip to first unread message

Valentin

unread,
Aug 8, 2019, 6:57:49 AM8/8/19
to Django users
Dear Django community,

Hi have problems understanding the difference between FILE_UPLOAD_MAX_MEMORY_SIZE vs. DATA_UPLOAD_MAX_MEMORY_SIZE.

Previously, I used django 1.11 and I had two different values, as we wanted to allow bigger file uploads than normal requests. So we had a higher limit for FILE_UPLOAD_MAX_MEMORY_SIZE.

However, after moving to django 2.x, I needed to increase the DATA_UPLOAD_MAX_MEMORY_SIZE value to allow big file uploads, and I don't understand why, as it is explicitely stated in the documentation that uploaded files are not considered for FILE_UPLOAD_MAX_MEMORY_SIZE.

The check is done when accessing request.body or request.POST and is calculated against the total request size excluding any file upload data. 

I'm using django 2.2.2 together with djangorestframework 3.9.4.

So the questions are:

- should they work as stated in the documentation?
- why don't they work like that for my setup?

So happy for any hint!

Thank you,
Valentin
Reply all
Reply to author
Forward
0 new messages