1

I am trying to upload a large file (approx 4GB) to my django website. I use the regular file upload method described in the django docs. I am serving the website with Nginx -> Gunicorn -> Django on EC2 instance.

Problem Uploading till 1GB files works fine. It works fine for smaller files but when I try to upload a file of 2GB or more I get a connect reset error in chrome.

Logs & specs There are nothing informative in logs I can find.

Versions: Django==3.2.4 Nginx==1.20

Config snippet: nginx.conf: ( in the http block)

client_max_body_size 4G;
client_body_buffer_size 4096M;
client_body_timeout 300;

Am I missing any django configuration? Hope somebody is able to shed some light on the cause and fix. Thanks for your time.

Amit Gupta
  • 11
  • 1

1 Answers1

0

I think it's a browser limit (es. chrome).

Probably you have to split the file and upload separately.

Marco
  • 1,494
  • 13
  • 23
  • Marco, Thanks for the response. But I am afraid its not the case. Chrome supports file upload for a size greater than 4GB. Moreover I have tried with multiple browsers and I get the same error everytime. Unfortunately, our application has to support a single file of 4GB so splitting the file is not an option for me. – Amit Gupta Oct 26 '21 at 14:22