Dropzone Submit Button on Upload : <p>I want to add a button upload to my dropzone file uploader. currently it's uploading the file directly after selecting or dragging the file into the dropzone area. What I want to do is:
1. Select or drap file to be uploaded.
2. Validate
3. Hit or press the button upload to upload the file.</p>

<p>N.B: File is only being uploaded after pressing the button upload.</p>

<p>Here is my form</p>

<pre><code>&lt;form id='frmTarget' name='dropzone' action='upload_files.php' class='dropzone'&gt;
   &lt;div class='fallback'&gt;
      &lt;input name='file' type='file' multiple /&gt;
   &lt;/div&gt;
   &lt;input id='refCampaignID' name='refCampaignID' type='hidden' value=\ "$rowCampaign-&gt;CampaignID\" /&gt;
&lt;/form&gt;
</code></pre>

<p>Here is my JS</p>

<pre><code>Dropzone.options.frmTarget = 
    {
            url: 'upload_files.php',
            paramName: 'file',
            clickable: true,
            maxFilesize: 5,
            uploadMultiple: true, 
            maxFiles: 2,
            addRemoveLinks: true,
            acceptedFiles: '.png,.jpg,.pdf',
            dictDefaultMessage: 'Upload your files here',
            success: function(file, response)
            {
                setTimeout(function() {
                    $('#insert_pic_div').hide();
                    $('#startEditingDiv').show();
                }, 2000);
            }
        };
</code></pre>

<p>Here is my php post request</p>

<pre><code> foreach ($_FILES["file"] as $key =&gt; $arrDetail) 
   {
      foreach ($arrDetail as $index =&gt; $detail) {
         //print_rr($_FILES["file"][$key][$index]);
         $targetDir = "project_images/";
         $fileName = $_FILES["file"]['name'][$index];
         $targetFile = $targetDir.$fileName;

         if(move_uploaded_file($_FILES["file"]['tmp_name'][$index],$targetFile))
         {
            $db = new ZoriDatabase("tblTarget", $_REQUEST["TargetID"], null, 0);
            $db-&gt;Fields["refCampaignID"] = $_REQUEST["refCampaignID"];
            $db-&gt;Fields["strPicture"] = $fileName;
            $db-&gt;Fields["blnActive"] = 1;
            $db-&gt;Fields["strLastUser"] = $_SESSION[USER]-&gt;USERNAME;
            $result = $db-&gt;Save();

            if($result-&gt;Error == 1){
               return "Details not saved.";
            }else{
               return "Details saved.";
            }
         }else{
            return "File not uploaded.";
         }
      }
   }
</code></pre>
