You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 14, 2019. It is now read-only.
Hello,
I have problems with cancelling file uploads.
Here is my helper button :
'click .btnCancel': function(e, instance) {
e.preventDefault();
if (FS.HTTP.uploadQueue.files && FS.HTTP.uploadQueue.files.attachments){
console.log("Queue is running : ", FS.HTTP.uploadQueue.isRunning()); //ok returns true;
const attachmentIdsOfFilesUploading = Object.keys(FS.HTTP.uploadQueue.files.attachments);
console.log("attachmentIdsOfFilesUploading : ", attachmentIdsOfFilesUploading); //return ["attachmentId1", "attachmentId2"]
FS.HTTP.uploadQueue.cancel();
console.log("Queue is running : ", FS.HTTP.uploadQueue.isRunning()); //ok return false;
Meteor.call("deleteAttachments", attachmentIdsOfFilesUploading, function(err){
//This performs Attachments.remove({'_id: {$in: ["attachmentId1", "attachmentId2"]}'})
if (err){
console.error(err); //Here we have error because collection FS is trying to remove the file (unlink) but as the file is not finished upladoed, it fails
toastr.error(err.reason);
return;
}
toastr.info(TAPi18n.__("Upload queue has been cancelled"));
window.location.reload(); //this is needed of collection FS crashes, the queue continue with some chunks...
});
}
},
Hello,
I have problems with cancelling file uploads.
Here is my helper button :
Thanks if you guys know what to do.