title: Dropzone.js upload image path into DB
body: <p>I am trying to upload a file path into my files table but with little success. I am using the dropzone.js lib to handle the drag and drop upload. I can successfully insert the file into an uploads file but I am struggling to get the path to create a row in the table:</p>
  
  <p>Here is how I create the form:</p>
  
  <pre><code>&lt;form action="actions/file-upload.php" class="dropzone"&gt;
  &lt;div class="fallback"&gt;
  &lt;input name="file" type="file" multiple /&gt;
  &lt;/div&gt;
  &lt;/form&gt; 
  
  &lt;?php
  $ds = DIRECTORY_SEPARATOR;  //1
  $storeFolder = '../uploads';   //2
  
  if (!empty($_FILES)) {
  
      $tempFile = $_FILES['file']['tmp_name'];          //3             
      $targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds;  //4
      $targetFile =  $targetPath. $_FILES['file']['name'];  //5
      move_uploaded_file($tempFile,$targetFile); //6
  
  
      if(move_uploaded_file($_FILES['file']['tmp_name'],$targetFile)){
          //insert file information into db table
          $conn-&gt;query("INSERT INTO files (name) VALUES('$tempFile')");
      }
  
  
  }
  ?&gt;  
  </code></pre>
  
  <p>I have sen similar threads on SO but nothing it glaringly obvious...</p>