dropbox / dropbox/dropbox-sdk-js

Cancel an upload request

Open
#223 8 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.