P Clegg P Clegg - 2 months ago 27x
jQuery Question

Jquery Dropzone dynamically change POST location

I have an issue regarding Dropzone.js, I am looking to be able to change the post URL dynamically such as :

window.onload = function() {
myDropzone = new Dropzone("#my-awesome-dropzone", {
url: "upload_file.php"
myDropzone.on("complete", function(file) {

Where you see url: "upload_file.php", I would like to change this property as and when I need to, this to enable me to change the path that files are stored so i can do something similar to:

url: "upload_file.php?path=/path/to/folder/"



Dropzone.options.myDropzone = {
  init: function() {
    this.on("processingfile", function(file) {
      this.options.url = "/some-other-url";

from: https://github.com/enyo/dropzone/wiki/Set-URL-dynamically