title: Object Not found in file upload PHP
body: <p>Im trying to upload a file but i keep getting the sent to an object not found page error 404.</p>
  
  <p>Im guessing that it is due to my path directory being wrong and the error exist between 'localhost' and C:\xampp\htdocs\PHP </p>
  
  <p>Thanks in advance </p>
  
  <p>My PHP code</p>
  
  <pre><code>&lt;?php
  
  $target_dir = "..\upload";
  $target_file = $target_dir.basename($_FILES["fileToUpload"]["name"]);
  $uploadOk = 1;
  $uploadError = "Error";
  $fileType = pathinfo($target_file,PATHINFO_EXTENSION);
  
      if(isset($_POST["submit"])) {
      $uploadOk = 1;
    }
  
  
      if (file_exists($target_file)) {
      $uploadOk = 0;
      $uploadError = "Sorry, file already exists.";}
  
      if ($_FILES["fileToUpload"]["size"] &gt; 100000) {
      $uploadOk = 0;
      $uploadError = "Sorry, your file is too large.";}
  
      if($fileType != "txt" ) {
          $uploadOk = 0;
          $uploadError = "Sorry, only NOW TXT files are allowed.";}
  
      if ($uploadOk == 0) {
          echo $uploadError;} else {
      if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
          echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
      } else {
          echo "Sorry, there was an error uploading your file.";
  }}?&gt;
  </code></pre>
  
  <p>My HTML</p>
  
  <p><code>&lt;form action=".php" method="post" enctype="multipart/form-data"&gt;
      Select image to upload:
      &lt;input type="file" name="fileToUpload" id="fileToUpload"&gt;
      &lt;input type="submit" value="Submit" name="submit"&gt;
  &lt;/form&gt;</code></p>