forwardemail / forwardemail/superagent
Restart an aborted upload
- Dominant language
- JavaScript
- Stars
- 16.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
I am using superagent v5.1.0 in a React file uploader component I am building. As a file is being uploaded, the component allows me to click a button and cancel the upload. Then I can click another button to restart it.
First I start my upload:
```
const formData = new FormData();
formData.append("file", theImageFile);
superagent
.send(formData)
.on('progress', () => { ... })
.end((err, response) => { ... })
```
Then I cancel my upload:
```
superagent.abort();
```
Finally, I restart my upload (same code as when start it) and superagent throws the error: "Can't merge these send calls". The error can be seen here: https://github.com/visionmedia/superagent/blob/56ce51728083392132505218c05edd5cf9f60c58/src/request-base.js#L609
How can I get around this? Is this possible in superagent?
Thanks.
Contributor guide
Assessment
This issue has not been assessed yet.