Answer the question
In order to leave comments, you need to log in
How to get response from server in DropZoneJS?
In php:
echo "ddddd";
or tried a million more options
in dropzone:
function(file,response){
console.log(response);
}
XHR finished loading: POST "http://domen.new/backend/portraits/upload-original".dropzone.js:1482 Dropzone.uploadFilesdropzone.js:1289
Dropzone.processFilesdropzone.js:1275
Dropzone.processFiledropzone.js:1268
Dropzone.processQueuedropzone.js:1151
(anonymous function)
create:891 undefined
Answer the question
In order to leave comments, you need to log in
figured it out myself.
Instead of:
function(file,response){
console.log(response);
}
function(file){
console.log(file.xhr.response);
}
Dropzone has Event success
The file has been uploaded successfully. Gets the server response as second argument. (This event was called finished previously)
var myDropzone = new Dropzone("#my-dropzone");
myDropzone.on("success", function(first,response) {
/* Maybe display some more file information on your page */
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question