-1

I wrote the following code, I expect a JSON object but returns always a string with the name of the file.

var app=$('#failed-fine-uploader').fineUploader({
    request: {
        endpoint: 'media/upload.php'
    }

}).on('complete', function (id, name,responseJSON) {
    alert(responseJSON.success);
    alert(responseJSON);

});

responseJSON.success is undefined and responseJSON is a string.

This is the response of upload.php:

{"success":"true","id":54,"type":"image\/jpeg","size":22568,"ext":"JPG","uploadName":"100-0027_IMG-645.JPG"}

I would like to read the values ​​in JSON like size and type.

Andrew
  • 1
  • 2

1 Answers1

0

Since you have double posted this question, and I answered in the github repo's issue tracker, I'll paste my response here.

Your handler is incorrect. The first parameter passed to event handlers when using the jquery plugin is always "event". Have a look at the jquery plugin section of the documentation.

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82