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?
-
Did you try something? I think you can split data in few part and compress it before upload ?! – Fky Oct 31 '16 at 08:56
-
@Fky I do this project to our employee can update the data without need me, what I do now i open my host ftp and upload the files. but I need to do script to upload this data without needed me, Its already work for small data < 100MB. – Samir Nabil Oct 31 '16 at 10:49
-
Yes but your script can run on your ftp server and split data + compress it before upload – Fky Oct 31 '16 at 10:52
-
could show me an example? – Samir Nabil Oct 31 '16 at 10:53
-
take a look http://www.phpclasses.org/package/8858-PHP-Create-and-merge-Zip-archives-split-in-parts.html – Fky Oct 31 '16 at 10:55
-
2Could you upload the files to a third party file hosting service like dropbox or Rackspace CloudFiles or Amazon S3? – S. Imp Jan 06 '17 at 18:20
-
I agree with @S.Imp you can upload files directly to S3 then simply post the route to the file. – Pitchinnate Jan 06 '17 at 19:44
-
The user has not specified anything about security concerns, and I don't know if putting the file right into S3 will allow permission-based access to the file. If anyone has any detail about that... – S. Imp Jan 06 '17 at 19:51
-
@S. Imp we already use wetransfer for transfer the data between the factory and head office. we need use this method for more securing. – Samir Nabil Jan 16 '17 at 10:06
2 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.
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

- 1
- 1

- 102
- 1
- 6
-
2This is worth a try but if it works you should change hosting provider. Any shared hosting provider that lets a client use `.htaccess` or `ini_set` etc to overwrite something they've specifically said "no" to is a hosting provider your should leave immediately as other clients will click, find other loopholes and soon abuse the service and take your website down with it. A good shared hosting provider will also block you from overwriting the global settings where they want to control your resource usage. – Robbie Nov 07 '16 at 05:12
-
I already change the php setting but `LimitRequestBody` its a Apache setting, i tried to change the limit in .hraccess but not work and my hosting refuse to change it. I test the limit i think its 100MB but i need make it 200MB – Samir Nabil Nov 07 '16 at 08:50
-
@SamirNabil 200 MB sounds huge. What kind of files are these? Just wondering. Are you sure the underlying process itself makes sense? – curious_cat Jan 01 '17 at 04:49
-
If I'm not mistaken, those PHP settings only come into play once apache allows the request. LimitRequestBody takes effect before they even come into play. – S. Imp Jan 06 '17 at 19:50
-
@curious_cat Yes its Huge but our tender department send huge data, we usually use other service like wetransfer and so on but we need something private for data secure. – Samir Nabil Jan 16 '17 at 10:02