Skip to content

Set URL dynamically

Matias Meno edited this page Jul 27, 2020 · 4 revisions

If you need to change the URL dropzone posts to dynamically for each file, you can use the processingfile event and change the options.url.

Example:

<form id="my-dropzone" action="/some-url" class="dropzone"></form>
<script>
Dropzone.options.myDropzone = {
  init: function() {
    this.on("processing", function(file) {
      this.options.url = "/some-other-url";
    });
  }
};
</script>
Clone this wiki locally