How the get the status of uploaded files when user clicks on cancel while uploading multiple files using ajax call.
This way im calling the ajax request to upload files:
var request = $.ajax({
url: 'files.php',
type: 'POST',
data: data,
cache: false,
contentType: false,
processData: false,
beforeSend: function () {
$(".progressbar").show();
},
xhr: function () {
var xhr = $.ajaxSettings.xhr();
if (xhr.upload) {
xhr.upload.addEventListener('progress', showProgress, false);
}
return xhr;
},
success: function (data) {
if (percentComplete <= 100) {
$('#pb div').animate({
width: '100%'
}, {
step: function (now) {
$(this).text(Math.round(now) + '%');
},
duration: 10
});
}
$('#uplcomp').append(data);
}
});
If user clicks on cancel button im doing this:
request.abort();
As the above statement just abort the ajax request , im not getting any response like how many files are uploaded, how much mb uploaded etc....
Can anyone help me on this?