Page 1 of 1

file upload over 2mb

Posted: Thu Nov 25, 2004 10:03 am
by lazerbri
hi is there a upload limmit when uploading a file using php to a dir

Code: Select all

<?php
#-----------------MAKE DIR-----------------------------------------

if ($TheFile != "") {
copy ("$TheFile", $DOCUMENT_ROOT."/folder/$TheFile_name") or die("Could not copy file");
}else { 
exit(); 
}
chmod("/$dir/$TheFile_name", 0755); 

?>
it will look like its working but any files over 2mb will not upload

can you help

thanks

Brian

Posted: Thu Nov 25, 2004 10:29 am
by Bill H
There ia a constant MAX_FILE_SIZE that defaults to 2Mb.
You can reset it in your form:

Code: Select all

<input type="hidden" name="MAX_FILE_SIZE" value="200000">
Use whatever size you wish, but your host may have parameter limits.

Posted: Thu Nov 25, 2004 10:35 am
by MarK (CZ)
There's also 'upload_max_filesize' var in php.ini.
You should check the filesize yourself with php because HTML can be changed by user, of course.

thanks now I no what the prob is thanks again

Posted: Thu Nov 25, 2004 11:39 am
by lazerbri
upload_max_filesize 2M you was right

thanks now I no what the prob is thanks again

Posted: Thu Nov 25, 2004 12:10 pm
by PanK
run <? phpinfo(); ?> it will tell the size.