I am using the blueimp File Upload plugin to implement some file upload functionality and I've noticed that there can be large gaps of time between when my last file progress bar hits 100% and when the stop and done events fire.I have the following code:
$('#fileupload').fileupload({
dataType: 'json',
progress: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
var bar = data.context.children().children(".progress");
$(bar).css("width", progress + "%");
},
add: function (e, data) {
data.context = $("<div></div>").html("Uploading...<div class='progressHolder'><div class='progress'> </div></div>").appendTo($("#files"));
data.submit();
$("#processing").fadeIn();
},
stop: function (e, data) {
$("#uploadFiles").fadeIn();
$("#processing").fadeOut();
},
done: function (e, data) {
$.each(data.result.files, function (index, file) {
idArray.push(file.Id);
});
}
});
Does anyone know why this would be happening? How can I make it so that the progress bars take into account when done/stop will be called?