Mozilla and postdata...
Posted: Thu Dec 09, 2004 2:00 pm
I have follwing part in my upload script, that determines allowed file extensions and max. file size.
In mozilla (firefox) it always throws an error "Invalid file type" as defined above, but with IE upload is ok. Why cant i upload with firefox? Smthn different in mozilla's headers?
Code: Select all
<?php
$allowed_types = array(
"image/gif" => "gif",
"image/pjpeg" => "jpg",
);
if(!array_key_exists($_FILES['userfile']['type'], $allowed_types)) {
die("<b>Invalid file type.</b>");
}
$maxfilesize = 307200;
if($_FILES['userfile']['size'] > $maxfilesize) {
die("File too large");
}
?>