how can i pass an extra parameter to jquery dropzone to my java controller method?

Can you try:

 $("div#uploadFile").dropzone({ 
                        
     url: "/demo/uploadFile"
    ,acceptedFiles: ".pdf"
    ,clickable: false
    ,maxFilesize: 100
    ,addRemoveLinks: true
    ,init: function() {
                         
              this.on('addedfile', function(file) {
                         //i can see the value in alert
                         alert($( "#selectedName" ).val()); 
              });
              this.on("sending", function(file, xhr, formData) {
                        formData.append("name", $( "#selectedName" ).val());
                        console.log(formData);
              });
              this.on('success', function(file, json) {
                         alert("ok");
              });
               
  });

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top