blueimp/jQuery-File-Upload — Issue #691: Creating a custom abort button
Author: intelligence
Created: 2011-10-08 17:27:55+00:00
State: open

I'm having some trouble with creating a custom abort button.
I can only abort one file, if I press abort on any other active upload, nothing happens (besides the upload gets hidden due to "hide"), and console doesn't say anything either.

Here's my code:

$('#fileupload').fileupload({
add: function(e, data) {
$('.progress_bar_wrapper').append($('.progress_context:first').clone());
data.context = $('.progress_context:last');
data.context.find($('.filename')).html(data.files[0].name);
data.context.show();
$('.fstart').click(function (e) {
jqXHR = data.submit();
});
$('.fabort').click(function (e) {
if(typeof jqXHR != 'undefined') {
jqXHR.abort();
data.context.hide('');
}
else {
data.context.hide('');
}
});
}
});

What am I doing wrong here?
Also looking for a way to cancel all uploads with a button click.