ionik Posted June 2, 2008 Share Posted June 2, 2008 PHP is supposed to be compatible through all browsers no problems...?? Well i quess internet explorer has found a way to mess up everything... I cannot upload images through Internet Explorer when i try to it says my image type is invalid but it works fine on Firefox heres the snippet of code. $allowed_ext_array = 'image/jpeg,image/gif'; $allowed_ext_array = explode(',', $allowed_ext_array); $error_messages .= ''; foreach($allowed_ext_array as $allowed_ext) { $strlen = strlen($allowed_ext) - 6; $names .= ' '.substr($allowed_ext, '6', $strlen); } if(!in_array($_FILES[$name]['type'], $allowed_ext_array)) { $error_messages .= 'Sorry, you are only allowed to upload '.$names.' file types'.'<br />'; } dont know why this would happen.... Link to comment https://forums.phpfreaks.com/topic/108409-solved-ie-php-error/ Share on other sites More sharing options...
discomatt Posted June 2, 2008 Share Posted June 2, 2008 Try adding image/jpg to your allowed mime types. Link to comment https://forums.phpfreaks.com/topic/108409-solved-ie-php-error/#findComment-555749 Share on other sites More sharing options...
ionik Posted June 2, 2008 Author Share Posted June 2, 2008 doesnt work... Link to comment https://forums.phpfreaks.com/topic/108409-solved-ie-php-error/#findComment-555754 Share on other sites More sharing options...
GingerRobot Posted June 2, 2008 Share Posted June 2, 2008 First step of debugging -- echo the problem part: if(!in_array($_FILES[$name]['type'], $allowed_ext_array)) { $error_messages .= 'Sorry, you are only allowed to upload '.$names.' file types'.'<br />'; echo $_FILES[$name]['type']; } Link to comment https://forums.phpfreaks.com/topic/108409-solved-ie-php-error/#findComment-555755 Share on other sites More sharing options...
rhodesa Posted June 2, 2008 Share Posted June 2, 2008 Check out this thread: http://www.phpfreaks.com/forums/index.php/topic,197915.0.html Link to comment https://forums.phpfreaks.com/topic/108409-solved-ie-php-error/#findComment-555756 Share on other sites More sharing options...
ionik Posted June 2, 2008 Author Share Posted June 2, 2008 ty problem solved Link to comment https://forums.phpfreaks.com/topic/108409-solved-ie-php-error/#findComment-555762 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.