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?
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 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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With