Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uploading large files with PHP web forms

Status
Not open for further replies.

Nilbus

Programmer
Jul 4, 2004
17
0
0
US
I had some trouble with trying to get my server to allow large uploads (100MB) from a web form, so here are some tips.

in your apache config file, add the section:
Code:
<Files *.php>
  SetOutputFilter PHP
  SetInputFilter PHP
  LimitRequestBody 104857600
</Files>

Then in your php.ini file edit the following lines so they look like this:
Code:
post_max_size = 100M
upload_max_filesize = 100M
These lines should already be there, so just edit them as needed.

Restart apache, and that should do it.

-Nilbus
 
Great tip!

quite usefull, just 1 question, what version of Apache is supported? I guess PHP version is 4.x and above... is it correct?

Cheers.
 
I use apache 2.0.49 and PHP 4.3.6, but it should work on other versions too. Check the documentation if you want to know if it'll work for you =)
 
Don't quote me on this, but I'm pretty sure you are opening the chance of the browser timing out before the upload completes.

For the size of files you are uploading, you should be using a method more suitable for the task such as FTP.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Hmm, you're right. The default timeout is ten minutes. To upload 100mb in 10 min, you need an upload speed of about 167k/s. I'll look into that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top