I'm trying to get the server response from a set of uploads using dropzone.js parallel uploading so that I can maintain the uploader's intended file order as I register the files in a mySQL database. My files are being uploaded just fine, and the "successmultiple" event is being fired as expected - but server response is empty.
jQuery(document).ready(function() {
Dropzone.autoDiscover = false;
var filedrop = new Dropzone("#filedrop", {
parallelUploads: 2,
uploadMultiple: true,
init: function() {
this.on("successmultiple", function(files, response) {
console.log(response);
});
},
url: "upload2.php"
});
});
If I assume the response is json and attempt to parse it as such:
var json = $.parseJSON(response);
$(json).each(function(i,val){
$.each(val,function(k,v){
console.log(k+" : "+ v);
});
});
I get a Uncaught SyntaxError: Unexpected end of JSON input
error. Is the response empty because I haven't echo'd anything from my upload2.php file? I'd like to get a response that gives me information about file order while retaining the important ability to do parallel uploads. Am I completely barking up the wrong tree trying to determine the file order with server response? Are there any dropzone.js experts in the wings?