How do you cancel a single upload?

Started by robbymarston2 replies1,675 views
robbymarstonOriginal post
#1

I see the cancelAll method in the documentation, but I’m not sure how to go about cancelling a specific upload. Seems like a common use-case, so I’m not sure what I’m missing. Any help is appreciated, thank you!

robbymarston
#2

Nevermind, turns out removeFile was what I was after.

#3

how did you implement that? docs seem to suggest that i set showRemoveButtonAfterComplete: true and do something like

.on('file-removed', (file, reason) => {
 if (reason === 'removed-by-user') {
  uppy.removeFile(file)
 }
})

but that doesn’t work at all.

i just want the file to be removed from the successful uploads field in the DOM, and it seems like that should work automatically? am i mistaken?