title: File uploads to another directory other than spcified directory in PHP code
body: <p>I have a folder struct like this:</p>
  
  <pre><code> admin-panel
       -- thesis-scripts
             -- add_thesis.php 
   uploads
  </code></pre>
  
  <p>And I am trying to upload a .docx file to the uploads directory. Here is my code:</p>
  
  <pre><code>$targ_dir = "uploads/";
  $targ_file = "../" . $targ_dir . basename($_FILES["thesisfile"]["name"]);
  $flagOk = 1;
  $tempFolder = $_FILES['thesisfile']['tmp_name'];
  if(move_uploaded_file($tempFolder, urlencode($targ_file))){
      echo $targ_file;
  } 
  </code></pre>
  
  <p>However, the code above results to a file upload inside the <code>thesis-scripts</code> folder. How can I move the file to the <code>uploads</code> folder? Thanks for the help. I purposely added the <code>../</code> in the <code>$targ_file</code> because I will save the file path in the database.</p>