file_exists ?
Moderator: General Moderators
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
Nope, should only need it in the dir where the form is, and possible the dir where the file that does the move_uploaded_file stuff is.
Your host may not allow you to override the upload size. One other solution is to remove the <INPUT TYPE="hidden" name="MAX_FILE_SIZE" lines from the form and just use your hosts 8M limit *shrug*
Your host may not allow you to override the upload size. One other solution is to remove the <INPUT TYPE="hidden" name="MAX_FILE_SIZE" lines from the form and just use your hosts 8M limit *shrug*
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
Your <INPUT TYPE="hidden" name="MAX_FILE_SIZE" .. appear to be overriding it somehow. I didn't think putting 2 of them in the same form would work, and it doesn't
So you may have to leave the hidden fields out and handle the allowed sizes in code using the size property of the $_FILES array.
Eg if($_FILES['mp3file']['size'] > 6000000){ ... } etc..same for the image file
Eg if($_FILES['mp3file']['size'] > 6000000){ ... } etc..same for the image file
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
oh, you mean if you want to use the 8M size limit but set a limit in the code?
Then you could just do something like :
$imglimit = 200000; //200K
$mp3limit = 6000000; //6M
if($_FILES['imagefile']['size'] > $imglimit){
echo 'Image is too big'; exit;
}
if($_FILES['mp3file']['size'] > $mp3limit){
echo 'Mp3 is too big'; exit;
}
Just put that anywhere before all the file_exists stuff.
Then you could just do something like :
$imglimit = 200000; //200K
$mp3limit = 6000000; //6M
if($_FILES['imagefile']['size'] > $imglimit){
echo 'Image is too big'; exit;
}
if($_FILES['mp3file']['size'] > $mp3limit){
echo 'Mp3 is too big'; exit;
}
Just put that anywhere before all the file_exists stuff.
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm