title: Dropzone.js file not uploading files to server
body: <p>Edit: Also I want to add, I get no errors whatsoever either in js, or PHP.</p>
  
  <p>Technically, am using a form where I want the seller to fill up the necessary stuff of a product, also including the Image of the product to show in the Shopping area. I hate the default input type file of html5, and I have a hard time hiding it, so I came across with dropzone. Now dropzone kinda works on the client side, but doesn't seem to be working on the Server side. No file gets uploaded on the redirect I want it to be sent.</p>
  
  <p>This is kind of a new thing to me, so I'm lost on what to do.</p>
  
  <p>this is the html code</p>
  
  <pre><code>&lt;form enctype='multipart/form-data' action='upload.php' method='POST'&gt;
  &lt;div class='form-group'&gt;
                      &lt;input class='form-control' type='text' placeholder='Title' id='titleInput' name='titleInput'&gt;
                  &lt;/div&gt;
  &lt;div class='form-group'&gt;
                      &lt;input class='form-control' type='number' placeholder='Price' id='priceInput' name='priceInput'&gt;
                  &lt;/div&gt;
  &lt;div class='dropzone' id='myDropzone'&gt;
                  &lt;/div&gt;
  &lt;button id='submit-all' type='submit' name='Post'&gt;Submit&lt;\button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>the javascript code</p>
  
  <pre><code>Dropzone.options.myDropzone= {
      url: 'upload.php',
      paramName: "file",
      autoProcessQueue: false,
      uploadMultiple: false,
      //parallelUploads: 5,
      //maxFiles: 5,
      maxFilesize: 1,
      acceptedFiles: 'image/*',
      addRemoveLinks: true,
      init: function() {
          dzClosure = this; // Makes sure that 'this' is understood inside the functions below.
  
          // for Dropzone to process the queue (instead of default form behavior):
          document.getElementById("submit-all").addEventListener("click", function(e) {
              // Make sure that the form isn't actually being sent.
              //e.preventDefault();
              e.stopPropagation();
              dzClosure.processQueue();
          });
  
          //send all the form data along with the files:
          this.on("sendingmultiple", function(data, xhr, formData) {
              formData.append("titleInput", jQuery("#titleInput").val());
              formData.append("priceInput", jQuery("#priceInput").val());
          });
  
      }
  }
  </code></pre>
  
  <p>And the upload.php code</p>
  
  <pre><code>&lt;?php
  
  if(isset($_POST['Post'])){
      if(isset($_FILES['file']['name'])){
          $imageName = $_FILES['file']['name'];
          $imageNameTemp = $_FILES['file']['tmp_name'];
          echo $imageName;
      }
      else{
          $imageName = "";
          echo "null";
      }
    $errorMessage = "";
  
    if($imageName != "") {
      $targetDir = "assets/images/productImages/";
      $imageName = $targetDir . uniqid() . basename($imageName);
      $imageFileType = pathinfo($imageName, PATHINFO_EXTENSION);
  
      if($_FILES['file']['size'] &gt; 5000000) {
        $errorMessage = "Sorry your file is too big!";
        $uploadOk = 0;
      }
  
      if(strtolower($imageFileType) != "jpeg" &amp;&amp; strtolower($imageFileType) != "png" &amp;&amp; strtolower($imageFileType) != "jpg") {
        $errorMessage = "Sorry, only jpeg, jpg and png files are allowed";
        $uploadOk = 0;
      }
  
      if(strtolower($imageFileType) == "jpeg" || "jpg"){
        $src = imagecreatefromjpeg($imageNameTemp);
      }
  
      if(strtolower($imageFileType) == "png"){
        $src = imagecreatefrompng($imageNameTemp);
      }
  
      if($uploadOk == 1) {
  
        list($width_min, $height_min) = getimagesize($imageNameTemp);
        if($width_min &gt; 1920){
          $newwidth_min = 1920;
          $newheight_min = ($height_min / $width_min) * $newwidth_min;
        }
        else if($height_min &gt; 1920){
          $newheight_min = 1920;
          $newwidth_min = ($height_min / $width_min) * $newheight_min;
        }
        else{
          $newheight_min = $height_min;
          $newwidth_min = $width_min;
        }
        $tmp_min = imagecreatetruecolor($newwidth_min, $newheight_min);
        imagecopyresampled($tmp_min, $src, 0, 0, 0, 0, $newwidth_min, $newheight_min, $width_min, $height_min);
        imagejpeg($tmp_min, $imageName);
        $uploadOk = 1;
  
      }
  
        else {
          //image did not upload
          $uploadOk = 0;
        }
  
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>So, when it redirects to upload.php, it echoes null because that what i wrote, if no file is sent.</p>
  
  <p>Please help</p>