PHP upload issue with code
<p>I keep getting the invalid file error. Can anyone see what is wrong with this script please. I got it from w3 schools and the folder "pics/2012/Blackhall Primary/" does exist</p>

<pre><code>&lt;?php

    if ((($_FILES["file"]["type"] == "image/gif")
    || ($_FILES["file"]["type"] == "image/jpeg")
    || ($_FILES["file"]["type"] == "image/png")
    || ($_FILES["file"]["type"] == "image/jpg")
    || ($_FILES["file"]["type"] == "image/pjpeg"))
    &amp;&amp; ($_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;";

        if (file_exists("pics/2012/Blackhall Primary/" . $_FILES["file"]["name"]))
          {
          echo $_FILES["file"]["name"] . " already exists. ";
          }
        else
          {
          move_uploaded_file($_FILES["file"]["tmp_name"],
          "pics/2012/Blackhall Primary/" . $_FILES["file"]["name"]);
          echo "Stored in: " . "pics/2012/Blackhall Primary/" . $_FILES["file"]["name"];
          }
        }
      }
    else
      {
      echo "Invalid file";
      }
    ?&gt;
</code></pre>
