title: Dropzone.js - callback to queue / upload next file
body: <p>I am using dropzone to upload multiple files to my upload script, which saves them and adds them and adds them to my DB. There is a problem, in that files sometimes upload so fast that the backend script gets confused and sometimes processes the same file twice. <strong>My proposed solution is to upload a file, wait for a callback from the PHP script, then upload the next one.</strong> </p>
  
  <p>This should be possible with Dropzones options, but I can't get it to work. </p>
  
  <pre><code>var dropZoneOptions = {
    paramName: "file", 
    maxFilesize: 100, // MB
    addRemoveLinks: true,
    dictRemoveFile: 'Go away',
    createImageThumbnails: true,
    addRemoveLinks : true,
    uploadMultiple: false,
    parallelUploads: 1,
    autoProcessQueue: false,
    addedFile: function() {
       this.on("addedfile", function(file) {
         processFile(file);
         alert("Added file.");
       });
    },
    success:function(file,response){
       this.on("success", function(file) {
         enqueueFile(file);
         console.log(file);
       })
     }
  };
  </code></pre>
  
  <p>The idea is for the above code to pause (autoProcessQueue: false) to wait for a response then use the enqueue file command to continue the next one (parallelUploads: 1). But my code above doesn't run the queue. </p>
  
  <p>The docs for the enqueue function are here: <a href="http://www.dropzonejs.com/#enqueuing-file-uploads" rel="nofollow noreferrer">http://www.dropzonejs.com/#enqueuing-file-uploads</a> </p>
  
  <p>Any Dropzone experts out there who can help me? Thanks in advance.</p>