Cancel Uploads
Cancel individual uploads using cancelTask() or cancel all uploads at once with cancelAll().
var uploader = new MultipleUpload(document.getElementById('demo-cancel'), {
uploadUrl: '/api/upload',
multiple: true,
concurrency: 2
});
document.getElementById('cancel-all-btn').addEventListener('click', function() {
uploader.cancelAll();
});
document.getElementById('clear-done-btn').addEventListener('click', function() {
uploader.clearCompleted();
});
Stopping what is in flight
The instance exposes cancelAll() for the whole queue and cancelTask(task) for one file, alongside pauseAll() and pauseTask() when the intent is to resume rather than abandon. Cancelling aborts the request; it does not by itself remove what the server already wrote.
Cancel is a user-facing promise
If uploads are stored as they complete, a cancel that leaves half a file on the server is not the cancel the user believes they got. Either upload to a staging location that a later step promotes, or give the cancel path a cleanup call. Chunked uploads make this easier: an incomplete chunk set was never assembled into a file.