title: PHP File Upload / move_uploaded_file Not Working
body: <p>I have the following form: </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;form action="upload_file.php" method="post" enctype="multipart/form-data"&gt;
  &lt;label for="file"&gt;Filename:&lt;/label&gt;
  &lt;input type="file" name="file" id="file" /&gt; 
  &lt;br /&gt;
  &lt;input type="submit" name="submit" value="Submit" /&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And the following script:</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  
  if (($_FILES["file"]["size"] &lt; 20000))
    {
    if ($_FILES["file"]["error"] &gt; 0)
      {
      echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br /&gt;";
      }
    else
      {
      echo "Upload: " . $_FILES["file"]["name"] . "&lt;br /&gt;";
      echo "Type: " . $_FILES["file"]["type"] . "&lt;br /&gt;";
      echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb&lt;br /&gt;";
      echo "Temp file: " . $_FILES["file"]["tmp_name"] . "&lt;br /&gt;";
  
  
      $moved = move_uploaded_file($_FILES["file"]["tmp_name"], "C:/inetpub/wwwroot/PHP_Ramp/upload/" . $_FILES["file"]["name"]);
  
      if ($moved) {
          echo "Move: Success";
      }
      else {
          echo "Move Failed";
      }
  
  
        echo "Stored in: " . "C:/inetpub/wwwroot/PHP_Ramp/upload/" . $_FILES["file"]["name"];
        }
      }
  
  else
    {
    echo "Invalid file";
    }
  ?&gt;
  </code></pre>
  
  <p>For some reason I keep getting "Move Failed".  Any idea why the file isn't moving? </p>
  
  <p>======== SO thinks I need to explain this more; so I'm typing a sentence down here. ========</p>