Page 1 of 1
Trouble with file uploading
Posted: Thu Jul 05, 2007 4:10 am
by sonirajesh
i am having trouble with uploading, when i upload big size file like >2M
it hang the browser and show blank screen and file does not get upload.
upload_max_filesize is set 8M
also added set_time_limit(0); in my script
But same thing on local network works file, seems problem in more setting.
please help
Rajesh Soni
Posted: Thu Jul 05, 2007 4:28 am
by volka
what does
Code: Select all
<?php
echo 'version: ', phpversion(), "<br />\n";
echo 'sapi: ', php_sapi_name(), "<br />\n";
foreach( array(
'max_execution_time', 'max_input_time',
'memory_limit', 'post_max_size',
'upload_tmp_dir', 'upload_max_filesize')
as $p ) {
echo $p, ': ', get_cfg_var($p), "<br />\n";
}
print?
Posted: Thu Jul 05, 2007 5:29 am
by sonirajesh
version: 5.1.4
sapi: apache2handler
max_execution_time: 30
max_input_time:
memory_limit: 32M
post_max_size: 8M
upload_tmp_dir:
upload_max_filesize: 2M
post_max_size: 8M
upload_max_filesize: 2M are handled by htaccess
and they are 16M and 8M respectively
Rajesh Soni
Posted: Thu Jul 05, 2007 5:50 am
by volka
sonirajesh wrote:
post_max_size: 8M
upload_max_filesize: 2M are handled by htaccess
and they are 16M and 8M respectively
I'm not sure what this means but...
get_cfg_var() says 2M and you have trouble uploading files >2M. I think all points to upload_max_filesize beeing 2M

upload_max_filesize can be changed via htaccess but it doesn't look like this has happened.
Did you put my code snippet in your actual upload script? That would eliminate all doubts.
Posted: Fri Jul 06, 2007 4:28 am
by onion2k
Just for the record ... get_cfg_var() reports the php.ini value regardless of whether it's been overridden by htaccess. ini_get() reports the runtime value. Which is backwards in my opinion, but that's PHP for ya'.
Posted: Fri Jul 06, 2007 4:40 am
by volka
oops, my mistake.
should be
Code: Select all
echo $p, ': ', ini_get($p), "<br />\n";
then.