title: move_upload_file does not create file
body: <p>I am writing a simple script that allows me to upload a file to a directory. To this end I use the following code:</p>
  
  <pre><code>if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) 
  {
      echo "uploading successful";    
  }    
  else    
  {
      echo "There was an error uploading the file, please try again!";
  }
  </code></pre>
  
  <p>The strange thing is that if a file <code>$target_path</code> already exists, then the upload works successfully and the original file is overwritten. However, if the file does not exist, then I get the error message that is in the else clause. Any ideas what may be the reason?</p>