title: PHP: File upload move_uploaded_file() not working
body: <p>I just made a file upload code and I was wondering why the file upload wasn't working. I changed the upload dir to 0777. This is my upload HTML code:</p>
  
  <pre><code>&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;
  </code></pre>
  
  <p>And PHP Code:</p>
  
  <pre><code>&lt;?php
  if ($_FILES["file"]["error"] &gt; 0){
  echo "Error Code: " . $_FILES["file"]["error"] . "&lt;br /&gt;";
  }
  else
  {
  echo "Uploaded file: " . $_FILES["file"]["name"] . "&lt;br /&gt;";
  echo "Type: " . $_FILES["file"]["type"] . "&lt;br /&gt;";
  echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kilobytes&lt;br /&gt;";
  
  if (file_exists("/files/".$_FILES["file"]["name"]))
    {
    echo $_FILES["file"]["name"] . " already exists. No joke-- this error is almost &lt;i&gt;&lt;b&gt;impossible&lt;/b&gt;&lt;/i&gt; to get. Try again, I bet 1 million dollars it won't ever happen again.";
    }
  else
    {
    move_uploaded_file($_FILES["file"]["tmp_name"],"/filebro/".$_FILES["file"]["name"]);
    echo "Done";
    }
  }
  ?&gt;
  </code></pre>
  
  <p>So, what could the problem possibly be?</p>