<form action="/file-upload" class="dropzone" id="my-awesome-dropzone"></form>

<button id="submit-files">Upload</button>
// Init dropzone instance
Dropzone.autoDiscover = false
const myDropzone = new Dropzone('#my-awesome-dropzone', {
  autoProcessQueue: false
})

// Submit
const $button = document.getElementById('submit-files')
$button.addEventListener('click', function () {
  // Retrieve selected files
  const acceptedFiles = myDropzone.getAcceptedFiles()
  for (let i = 0; i < acceptedFiles.length; i++) {
    setTimeout(function () {
      myDropzone.processFile(acceptedFiles[i])
    }, i * 2000)
  }
})

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/min/dropzone.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.4.0/min/dropzone.min.js