Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Work around Error 413 request entity too large

Tags:

I'm working in project that allow to our employee to upload large files to our shared host and getting download link. the problem is that our hosting refuse to change LimitRequestBody for shared hosting. there is any other solution to work around LimitRequestBody or any other way to do this job?

like image 634
Samir Nabil Avatar asked Oct 24 '16 06:10

Samir Nabil


People also ask

How do you handle 413 payload too large?

Nginx will throw the same 413::Request Entity is too large exception. It wont forward the request to your express app. So we need to set client_max_body_size 50M; in the nginx config OR a specific server config OR even a specific location tag will work.

What is 413 Request Entity Too Large?

What does “413 Request Entity Too Large” mean? A 413 HTTP error code occurs when the size of a client's request exceeds the server's file size limit. This typically happens when a client attempts to upload a large file to a web server, and the server responds with a 413 error to alert the client.

How do I fix Nginx 413 Request Entity Too Large?

Error: 413 “Request Entity Too Large” in Nginx with “client_max_body_size” / Changes in Nginx config file. This is happening because of your nginx server not allow to upload file which is larger than defined size in nginx config file.To solve it , you have to modify your nginx configuration.


1 Answers

Two ways to get it work, manual chunk upload or by tools.

You can use Real Ajax Uploader tool. It can used with html5 the upload of the files is done by chunks, with small request to the server for perfomance and robustness.

Or manually split the files to many chunks then upload them one by one. you can use 7-zip to split file and combine files. here is an tutorial.

For client split you also refer to File uploads; How to utilize "chunking"?

For sever chunk combine you can refer to Handling plupload's chunked uploads on the server-side and http://www.phpclasses.org/package/8858-PHP-Create-and-merge-Zip-archives-split-in-parts.html

hope it helps.

like image 93
LF00 Avatar answered Oct 06 '22 06:10

LF00