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.... Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
ionik Posted June 2, 2008 Author Share Posted June 2, 2008 doesnt work... Quote Link to comment 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']; } Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
ionik Posted June 2, 2008 Author Share Posted June 2, 2008 ty problem solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.