DropzoneJS: How to get PHP response after upload success?

前端 未结 6 1709
粉色の甜心
粉色の甜心 2020-12-29 01:53

I\'m trying to implement Dropzone on my site. I want to listen for the \"success\" event and then take the server response and add some info from it to a form on the same pa

6条回答
  •  灰色年华
    2020-12-29 02:19

    But if I am using this code then i have to remove the dropzone class from form. Otherwise it will throw this error.

    throw new Error("Dropzone already attached.");
    ---------------------------------------------
    new Dropzone("#myDropzone", { 
        maxFilesize: 2, // MB
        init: function() {
            this.on("success", function(file, responseText) {
                console.log(responseText);
            });
        }
    });
    

提交回复
热议问题