I just tested this simple php file upload script. Works in all browsers except IE 🙁
IE prints “FILETYPE NOT SUPPORTED” as defined inside code:
if (isset($_POST['add'])) {
$order = $_POST['display_order'];
$img = $HTTP_POST_FILES['imagefile']['name'];
$url = $_POST['url'];
// CONNECT TO DB
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$types = array('image/jpeg', 'image/gif', 'image/png', 'image/tiff', 'image/bmp', 'image/pjpeg');
$target_path = "media/";
$target_path = $target_path . basename( $_FILES['imagefile']['name']);
if (in_array($_FILES['imagefile']['type'], $types)) {
if(move_uploaded_file($_FILES['imagefile']['tmp_name'], $target_path)) {
mysql_query(
"INSERT INTO slider_luxury
(display_order, imagefile, url)
VALUES
('$order', '$img', '$url')"
);
header('Location: luxury_slider.php');
} else {
echo "There was an error uploading the slide, please try again!";
}
} else {
echo "FILETYPE NOT SUPPORTED";
}
}
It means that IE send the png with another MIME type than “image/png” which is what you are expecting. Try to add to your array of accepted values:
Also see this What is the difference between "image/png" and "image/x-png"?.