dropbox / dropbox/dropbox-sdk-js
Cancel an upload request
- Dominant language
- JavaScript
- Stars
- 970
- Forks
- 353
- Avg merge
- 9h 3m
- Merged PRs (30d)
- 2
Description
Hello,
I used Dropbox Javascript API, for uploading files. Here is my code :
```
let promise = this.dropbox.filesUpload({path: path + file.name, contents: file})
.then(function(result)
{
// Success workflow goes here ...
})
.catch(function(error) {});
```
I would like to implements a cancel button. When I clicked it, I would like to my `promise `request above was aborted.
I read this trick #159 but how can implement it directly with Dropbox JS SDK ?
I also find this way for cancelling fetch request with the `AbortController.abort() `: https://stackoverflow.com/questions/31061838/how-do-i-cancel-an-http-fetch-request
but it's not possible pass `fetchOptions `in `Dropbox.filesUpload() `method.
Does anyone have a solution for this issue ?
Thanks you in advance !
Contributor guide
Assessment
This issue has not been assessed yet.