johnharris Posted September 12, 2006 Share Posted September 12, 2006 I have an upload script written in php for uploading images etc. It works fine in firefox, however not in IE....[code]if (isset($_FILES['uploadedphoto'])) { $targetpath = "images/photos/profiles"; if (($_FILES["uploadedphoto"]["type"] == "image/gif") || ($_FILES["uploadedphoto"]["type"] == "image/jpeg") && ($_FILES["uploadedphoto"]["size"] < 700000)) { if ($_FILES["uploadedphoto"]["error"] > 0) { echo "Return Code: " . $_FILES["uploadedphoto"]["error"] . ". Profile photo was not uploaded.<br />"; } else { if (file_exists($targetpath . "/" . $_FILES["uploadedphoto"]["name"])) { echo $_FILES["uploadedphoto"]["name"] . " already exists. Profile photo was no uploaded"; } else { if (move_uploaded_file($_FILES["uploadedphoto"]["tmp_name"], $targetpath . "/" . $_FILES["uploadedphoto"]["name"])) { $completeurl = $targetpath . "/" . $_FILES["uploadedphoto"]["name"]; $query = "UPDATE users SET pic_url='$completeurl' WHERE username='$u'"; $result = @mysql_query($query); if (!$result) { echo 'Profile photo was not uploaded.'; } } else { echo 'Profile photo was not uploaded.'; } } } } else { echo "Invalid profile photo - file size too big (must be under 700kb) / wrong file type (must be jpeg or gif)"; } }[/code]As i said, in firefox it works fine, in IE the "else" statement of the ..."if (($_FILES["uploadedphoto"]["type"] == "image/gif") || ($_FILES["uploadedphoto"]["type"] == "image/jpeg") && ($_FILES["uploadedphoto"]["size"] < 700000)) {" ... is called. Link to comment https://forums.phpfreaks.com/topic/20558-upload-script-problem-with-ie/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.