I\'m experimenting with Blueimp\'s jQuery-File-Upload plugin, which judging by the demo looks very promising.
It\'s really easy to implement:
var $up
This didn't work for me.
$('#fileupload').fileupload({url: '/url/to/server/'});
$('#fileupload').bind('fileuploaddone', function (e, data) {
console.log('success!!!');
console.log(e);
console.log(data);
});
But this did!
$('#fileupload').fileupload({url: '/url/to/server/'}).bind('fileuploaddone', function (e, data) {
console.log('success!!!');
console.log(e);
console.log(data);
});
My first guess is that in the first case you are binding the event to the actual form input instead of the fileupload object, and in the second, by using chainning you are actually using the fileupload object, I guess the documentation is ambiguous since it reads:
$('#fileupload').bind('fileuploadadd', function (e, data) {/* ... */});
And it should read
$('#fileupload').fileupload().bind('fileuploadadd', function (e, data) {/* ... */});