php - File upload not working in IE -
php - File upload not working in IE -
i tested simple php file upload script. works in browsers except ie :(
ie prints "filetype not supported" defined within code:
if (isset($_post['add'])) { $order = $_post['display_order']; $img = $http_post_files['imagefile']['name']; $url = $_post['url']; // connect db mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "unable 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 slider_luxury (display_order, imagefile, url) values ('$order', '$img', '$url')" ); header('location: luxury_slider.php'); } else { echo "there error uploading slide, please seek again!"; } } else { echo "filetype not supported"; } }
it means ie send png mime type "image/png" expecting. seek add together array of accepted values:
image/x-png
also see what difference between "image/png" , "image/x-png"?.
php file upload
Comments
Post a Comment