Work around Error 413 request entity too large

别说谁变了你拦得住时间么 提交于 2019-12-22 01:24:31

问题


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?


回答1:


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.




回答2:


You can override default values of upload_max_filesize and post_max_size. Both of these two ini settings have change mode as PHP_INI_PERDIR which means you can either use one of the following

php.ini, .htaccess, httpd.conf, .user.ini

Since you're using shared hosting so best suitable option is .htaccess or .user.ini

You can refer this to set values using htaccess Set php Ini settings using htaccess



来源:https://stackoverflow.com/questions/40212229/work-around-error-413-request-entity-too-large

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!