How do I return data via Ajax using Plupload on Upload Complete?
Several files could have been uploaded as part of the upload process. The individuals responses are not avalaible anymore when on UploadComplete
stage.
If you want to display info about a specific file upload, you should bind to the FileUploaded
event instead of UploadComplete
.
Something like :
uploader.bind('FileUploaded', function(upldr, file, object) {
var myData;
try {
myData = eval(object.response);
} catch(err) {
myData = eval('(' + object.response + ')');
}
alert(myData.result);
});
Hope this will help