File Upload Limit

When things doesn't work as they should.
Post Reply
gareththered
Posts: 3
Joined: Mon Feb 11, 2019 10:48 am

File Upload Limit

Post by gareththered » Mon Feb 11, 2019 10:53 am

Hi,

I seem to get a 413 error each time I attempt to upload a file over 1MB. This used to be configurable in NGINX (and I believe the default was 500MB), but since the move to a Python powered web-server, I'm at a loss as to how to increase the limit.

I'm using the Docker image.

Any advice would be appreciated.

Thanks,

Gareth

User avatar
rosarior
Posts: 194
Joined: Tue Aug 21, 2018 3:28 am

Re: File Upload Limit

Post by rosarior » Tue Feb 12, 2019 8:41 pm

Looking at GUNICORN's documentation there doesn't seem to be a setting to control de HTTP request body size (http://docs.gunicorn.org/en/latest/settings.html). Apparently this is not possible (https://github.com/benoitc/gunicorn/issues/1659). Continuing to investigate.

User avatar
rosarior
Posts: 194
Joined: Tue Aug 21, 2018 3:28 am

Re: File Upload Limit

Post by rosarior » Tue Feb 12, 2019 8:54 pm

This post suggest it could be Dropzone.js, the widget used to upload the files (https://stackoverflow.com/questions/516 ... 30-seconds).

gareththered
Posts: 3
Joined: Mon Feb 11, 2019 10:48 am

Re: File Upload Limit

Post by gareththered » Tue Feb 12, 2019 9:35 pm

The linked page in your last posts suggests it's a 30 second limit. I get a 413 error as soon as a file is 1MB in size, which is a matter of a couple of seconds or so - definitely not 30 seconds.

If I click on the drag-and-drop area to open the file-open dialog, and select a 1MB file, I get the same results. Presumably, that's using the same JS to upload?

User avatar
rosarior
Posts: 194
Joined: Tue Aug 21, 2018 3:28 am

Re: File Upload Limit

Post by rosarior » Tue Feb 12, 2019 10:20 pm

Yes, it is the same widget that services interactive uploads using a drop or by clicking the "Browse" button.

I'm investigating DropZone's maxFilesize setting (https://www.dropzonejs.com/#config-maxFilesize) the description is confusing because it appears to be a file size limit but the description say it limits the number of files.

I have not been able to find any reference to a file size limit in GUNICORN and the responses seem to suggest it doesn't and instead relies on the frontend webserver to do the HTTP body size limiting. Not discarding it yet but looking at all the alternatives.

gareththered
Posts: 3
Joined: Mon Feb 11, 2019 10:48 am

Re: File Upload Limit

Post by gareththered » Wed Feb 13, 2019 6:48 am

I've just been reading the Stackoverflow entries tagged dropzone.js and they seem to suggest that there is a `maxFile` and a `maxFileSize` option available, with the former being the number of files and the latter the size. The documentation you link to states that the default is 256, but doesn't state the units - 256 bytes, 256 TB, or as you said 256 files? None of those align with my single 1MB file though.

Also, the HTTP 413 error that shows up is a server error: https://httpstatuses.com/413 suggesting that this isn't a dropzone.js error.

EdwardZem
Posts: 2
Joined: Wed Mar 20, 2019 6:00 am

File Upload Limit

Post by EdwardZem » Sun Mar 24, 2019 12:17 am

Hi Panos,

If you want to increase the load of up to 20 MB, then you need to do:

Change the file php.ini:
upload_max_filesize = 20M
post_max_size = 20M

Or

Change the file .htaccess:
php_value upload_max_filesize 20M
php_value post_max_size 20M

Post Reply