title: Send Dropzonejs file with jQuery AJAX POST request on form submit
body: <p>I have attachment form with dropzonejs file upload and note field and need to send those both fields data to my server on jQuery AJAX form submit. </p>
  
  <p>Attachment HTML Form code</p>
  
  <pre><code>&lt;form id="addAttachmentForm" method="post" enctype="multipart/form-data" novalidate="novalidate"&gt;
  &lt;div class="modal-body"&gt;
      &lt;div class="companyAttachment box__input dz-clickable"
      &lt;/div&gt;
      &lt;textarea class="form-control resizeNone" name="Note" placeholder="Your note here" rows="5"&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  &lt;div class="modal-footer"&gt;
      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
      &lt;button type="submit" class="btn btn-primary btn-Attachment" id="add-attachment"&gt;ADD ATTACHMENT&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>JS Code</p>
  
  <pre><code>$(document).on('submit', '#addAttachmentForm',function(e) {
  e.preventDefault();
      $.ajax({
          type: 'POST',
          url: '/attachment/store',
          data: new FormData(this),
          contentType: false,
          cache: false,
          processData:false,
          beforeSend: function () {
          },
          success: function(response)
          {
              // contactDropzone.processQueue();
          },
          error: function (data) {
          }
      });});
  
  Dropzone.autoDiscover = false;
  var contactDropzone = $('.companyAttachment').dropzone({
     url: null,
     paramName: 'file',
     addRemoveLinks: true,
     maxFiles: 1,
     autoProcessQueue: false,
     maxFilesize: 2,
     acceptedFiles: 'image/*,application/pdf',
     init: function(){
         this.on("addedfile", function(file, data) {
         });
     }});
  </code></pre>
  
  <p>I set the default value of autoProcessQueue is false, but I'm confused about when I need to call <strong>contactDropzone.processQueue()</strong> method to work for AJAX form submission? or please suggest me any other better ways to POST attachment and note fields data on jQuery AJAX form submission.</p>