PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
lazerbri
Forum Newbie
Posts: 15 Joined: Sat Dec 27, 2003 8:17 am
Post
by lazerbri » Thu Nov 25, 2004 10:03 am
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
Bill H
DevNet Resident
Posts: 1136 Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:
Post
by Bill H » Thu Nov 25, 2004 10:29 am
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.
MarK (CZ)
Forum Contributor
Posts: 239 Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:
Post
by MarK (CZ) » Thu Nov 25, 2004 10:35 am
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.
lazerbri
Forum Newbie
Posts: 15 Joined: Sat Dec 27, 2003 8:17 am
Post
by lazerbri » Thu Nov 25, 2004 11:39 am
upload_max_filesize 2M you was right
thanks now I no what the prob is thanks again
PanK
Forum Commoner
Posts: 36 Joined: Mon Nov 22, 2004 1:24 pm
Location: Richmond Hill, ON, Canada
Post
by PanK » Thu Nov 25, 2004 12:10 pm
run <? phpinfo(); ?> it will tell the size.