Jump to content


upload problem


  • Please log in to reply
No replies to this topic

#1 _*Magnetronkip_*

_*Magnetronkip_*
  • Guests

Posted 12 August 2004 - 07:24 AM

when iam trying to upload something i will get this error

Warning: move_uploaded_file(public_html/files755_SKATE.gif): failed to open stream: No such file or directory in /home/flash-heaven/public_html/test/upload.php on line 33

Warning: move_uploaded_file(): Unable to move '/home/tmp/phpk2qSnh' to 'public_html/files755_SKATE.gif' in /home/flash-heaven/public_html/test/upload.php on line 33


here is the upload.php file
<?php 
  //Define some variables 
      $dir = "public_html/files"; //Change this to the correct dir 
    //MIME types to allow, Gif, jpeg, zip ::Edit this to your liking 
      $types = array("image/gif","image/pjpeg","application/"); 
    
//Check to determine if the submit button has been pressed 
    if(isset($_POST['submit'])){ 

//Shorten Variables 
     $tmp_name = $_FILES['upload']['tmp_name']; 
     $new_name = $_FILES['upload']['name']; 



//Check MIME Type 
    if (in_array($_FILES['upload']['type'], $types)){ 
      
             
                  
      
         //Move file from tmp dir to new location 

        move_uploaded_file($tmp_name,$dir . $new_name); 
          
        echo " was uploaded sucessfully!";                  
              
           
          
    }else{ 
          
      
    //Print Error Message 

          
    echo "<small>File <strong><em></em></strong> Was Not Uploaded!</small><br />"; 
     
    //Debug 
   $name =  $_FILES['upload']['name']; 
   $type =    $_FILES['upload']['type']; 
   $size =    $_FILES['upload']['size']; 
   $tmp =     $_FILES['upload']['name']; 
    
   echo "Name: $name<br/ >Type: $type<br />Size: $size<br />Tmp: $tmp"; 
             
    } 
      
    } 
      
      
else{ 
      
      
    echo 'Could Not Upload Files'; 
      
} 
        ?> 
          
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> 
      
      <fieldset> 
              <legend>Upload Files</legend> 
            
                
                    
          <input type="file" name="upload" /> 
</fieldset> 
<input type="submit" name="submit" value="Upload Files" /> 
</form>

this is on line 33
move_uploaded_file($tmp_name,$dir . $new_name);

can somebody help me?
nobody can? :) :hi:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users