i have a problem with uploading file in IE

Discussion in 'PHP' started by lopy_is_me, Aug 16, 2008.

  1. #1
    hi all,
    i have created a script for uploading picture files and it works perfectly in firefix but in IE 6 or 7 it gives me this error :

    Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpFuOidl' to '' in /home/site/public_html/upload.php on line 75
    error in saving file

    my script is :

    
    
    
    <?
    require("functions.php");
    if($_POST["submit"]){
    
    $upload_file;
    $msg = "";
    
    
    if($_FILES["userfile"] == ""){
    	$upload_file = false;
    	$msg .= "please select a picture file to upload .<br>";
    }else{
    	$userfile = $_FILES["userfile"];
    	$userfile_name = $_FILES["userfile"]["name"];
    	$userfile_size = $_FILES["userfile"]["size"];
    	$userfile_type = $_FILES["userfile"]["type"];
    }
    
    if(!($userfile_type == "image/jpg" or $userfile_type == "image/jpeg" or $userfile_type == "image/png" or $userfile_type == "image/gif")){
    	$msg .= "<br>extension allowed only : jpg & jpeg & gif & png";
    	$upload_file = false; 
    }else{
    	$upload_file = true;
    }
    
    if($userfile_size > 1024000){
    	$msg .= "max file size is : 1024 KB";
    	$upload_file = false;
    }else{
    	$upload_file = true;
    }
    
    $path = "upload/".next_file_name().".jpg";
    // next_file_name() is  function that gets the new name from the BataDase
    
    if($upload_file == false){
    	echo $msg;
    }else{
    	if(move_uploaded_file($userfile["tmp_name"], $path)){// line where the error pointing
    		echo "<br>";
    		echo "file uploaded successfuly";
    		chmod("{$path}",0777);
    	}else{
    		echo "error in saving file";
    	}
    }
    
    
    
    ?>
    
    
    
    
    PHP:
    please i need help this script is again run perfectly in Firefox but in IE i don't know what happend
     
    lopy_is_me, Aug 16, 2008 IP
  2. lopy_is_me

    lopy_is_me Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    why there no one answer me ????????
     
    lopy_is_me, Aug 16, 2008 IP
  3. Joseph S

    Joseph S Well-Known Member

    Messages:
    1,373
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Unable to move means a permission problem and should not work at all. Chmod tmp to 777. If that still not fix this, drop me a PM.
     
    Joseph S, Aug 16, 2008 IP
  4. lopy_is_me

    lopy_is_me Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    no the permission is right 0777 and it works fine in firefox the problem in IE i tried it on may PCs and it is the same problem on IE gives me this error but on firefox works fine
     
    lopy_is_me, Aug 16, 2008 IP
  5. lopy_is_me

    lopy_is_me Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    is there any one can solve me problem
     
    lopy_is_me, Aug 17, 2008 IP
  6. lopy_is_me

    lopy_is_me Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    guys I am really need your help in this
     
    lopy_is_me, Aug 20, 2008 IP