Page 1 of 1

Uploading HUGE files from a web browser???

Posted: Thu Aug 14, 2003 12:15 am
by Mr. Tech
I know how to upload files from a web browser but when I upload really large file(In MB)? It seems to timeout or something... Can anyone help?

Posted: Thu Aug 14, 2003 5:07 am
by iamwho
set max_execution_time(default:30s) longer in php.ini

Posted: Thu Aug 14, 2003 3:52 pm
by Galahad
I actually found that increasing the timeout value didn't make any difference. I don't believe that the php script starts running until after the file has been Completely uploaded (apache handles it). That's what my tests lead me to believe though, anyone know more of what's going on behind the scenes? We have a server running with a timeout of 30 seconds, but we can upload files that are several hundred megabytes.

I may have forgotten something, but here's what I remember changing:
(These files are where they are located in redhat running apache, I assume other platforms have similar files)
1. /etc/php.ini has a line "upload_max_filesize = 2M". Change it to whatever size you want.
2. /etc/httpd/conf.d/php.conf has a line "LimitRequestBody 524288". Since the file is sent to the browser as part of the request body, you need to change this value. Note that this is in bytes (1024 bytes to the kilobyte, 1024 kilobytes to the megabyte, etc). So if you want a 8 megabyte limit, you need to set this to 8 * 1024 * 1024 or 8388608. I'm not sure why this defaults to 512k since the php.ini max size defaults to 2M.

Anyway, I had much better success changing those values than I did with the timeout. Try them out.

Posted: Thu Aug 14, 2003 5:22 pm
by Mr. Tech
Thanks!

But what if I can't edit the php.ini file? :(

Posted: Thu Aug 14, 2003 5:59 pm
by mikusan
You make a .htaccess file with the following:
php_value max_post_size 50M
php_value max_input_time 100000
php_value max_execution_time 100000
php_value upload_max_filesize 50M

You can set any PHP values like this...there are also ways to set it through your scripts but i dunno

Posted: Thu Aug 14, 2003 6:05 pm
by Mr. Tech
thanks man! I'll try it!