Jump to content


Photo

Upload script problem with IE?


  • Please log in to reply
No replies to this topic

#1 johnharris

johnharris
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 September 2006 - 10:02 PM

I have an upload script written in php for uploading images etc. It works fine in firefox, however not in IE....


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)";
  
							}
						
						}


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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users