title: PHP Image Upload Error
body: <p>Here's my code within a form to upload a file....</p>
  
  <pre><code>            &lt;tr&gt;
              &lt;td&gt;File&lt;/td&gt;
              &lt;td&gt;&lt;input type="file" name="file" id="file"&gt;&lt;br&gt;&lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>
  
  <p>And here's my php within the action page:</p>
  
  <pre><code>$allowedExts = array("gif", "jpeg", "jpg", "png");
  $temp = explode(".", $_FILES["file"]["name"]);
  $extension = end($temp);
  if ((($_FILES["file"]["type"] == "image/gif")
  || ($_FILES["file"]["type"] == "image/jpeg")
  || ($_FILES["file"]["type"] == "image/jpg")
  || ($_FILES["file"]["type"] == "image/pjpeg")
  || ($_FILES["file"]["type"] == "image/x-png")
  || ($_FILES["file"]["type"] == "image/png"))
  &amp;&amp; ($_FILES["file"]["size"] &lt; 2000000)
  &amp;&amp; in_array($extension, $allowedExts))
    {
  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;";
  
     if (file_exists("upload/" . $_FILES["file"]["name"]))
    {
    echo $_FILES["file"]["name"] . " already exists. ";
    }
  else
    {
    move_uploaded_file($_FILES["file"]["tmp_name"],
    "upload/" . $_FILES["file"]["name"]);
    echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
  
    }
  }
   }
   else
     {
      echo "Invalid file";
    }
  </code></pre>
  
  <p>THe image seems to upload ok, but moving things around doesn't seem to be working. I get the following error...</p>
  
  <pre><code>Upload: bobscafe.png
  Type: image/png
  Size: 200.578125 kB
  Temp file: /home/content/03/12112303/tmp/phpOR48Au
  </code></pre>
  
  <blockquote>
    <p>Warning: move_uploaded_file(upload/bobscafe.png)
    [function.move-uploaded-file]: failed to open stream: No such file or
    directory in /home/content/03/12112303/html/kena/builder.php on line
    38</p>
    
    <p>Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
    move '/home/content/03/12112303/tmp/phpOR48Au' to
    'upload/bobscafe.png' in
    /home/content/03/12112303/html/kena/builder.php on line 38 Stored in:
    upload/bobscafe.png98802424</p>
  </blockquote>
  
  <p>Anyone know what I'm doing wrong?</p>
  
  <p>Thanks!</p>