All Things Web 2.0
19 Sep
Let me first start by saying that I’m currently working at a startup, and for anyone who’s ever done this, you know it sucks up a LOT of your time… in my case pretty much all of it. I’m not complaining by any means, I’m doing some of the coolest work I’ve ever done in fact! However, I just wanted to explain my little posting hiatus…
Anyway, on to the matter at hand. I have found myself in a position where I am writing scripts that may need to upload fairly large files. My scripts were timing out, and I couldn’t seem to figure out why. For the unitiated, there are some standard things that you usually do to both your php.ini and in your script in this situation:
However, it turns out there are some other php.ini config variables that you may need to look at:
That’s about it! Quick and simple solution to a problem that is probably pretty common.
4 Responses for "Uploading Large Files With PHP"
Pretty good work! I found myself in the same boring situation and reached the shore doing exactly what you describe in this post… But what if sizes are really large? I.E. : 50M. How can we implement a systerm that allows such an upload without crash our system?
Hey thanks for this.
I was having the same issue.
I changed the max_upload_size but not the others. Stupid how they rely on each other. But it works now!
Very useful, thanks. There are several articles out there for “large uploads via PHP” but they seem to only have partial settings mentioned.
It’s very important that post_max_size is > max_upload_size. If only by a small amount.
I’m in the process of setting up an app that will need to allow uploads up to 500M. — Lorenzo, follow these instructions and you should be ok. Also make sure to set in your form (where value= whatever size you need in bytes)
im still troubled and cant get my uploader work. still uploads only below 2M my hosting is 1and1 and i cant make it work ‘duh!’
Leave a reply