P Clegg P Clegg - 1 year ago 295
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/"

Answer Source


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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download