Jump to content

uploading files in fragments


shane07

Recommended Posts

Hello

 

I have got problem in uploading larger sized files.

The server has given 'post_max_size' of 8 M

I tried to change it through .htaccess file and ini_set() function, but could not succeed.

And then I come to a decision to upload the files in fragments.

So I want to know if it could be done with PHP scripts?

Any help would be appreciable.

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/108978-uploading-files-in-fragments/
Share on other sites

I agree with anthonydamasco, but to add another option (if they don't change the php.ini for you, and you don't want to move, but you have ssh access):

you can run a script from either shell_exec or by going in via ssh (if you have access), which will take your multi-part files, and rejoins them.

Lets say you have 10 files:

zipfile.zip.01

zipfile.zip.02

zipfile.zip.03

zipfile.zip.04

zipfile.zip.05

zipfile.zip.06

zipfile.zip.07

zipfile.zip.08

zipfile.zip.09

zipfile.zip.10

You run this script in that folder

cat zipfile.zip.* > zipfile.zip

and it will join all the files together, in the proper order.

With that said, I agree that you should raise hell about the max file upload.

Show use the setting you used in .htaccess and what were the results? Any errors?

 

You cannot change that specific value using ini_set(). You can change it in a .htaccess file if php is running as an Apache module and the host has permitted that setting to be changed. You can change it in a local php.ini file if php is running as a CGI wrapper and the host has permitted that setting to be changed.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.