forwardemail / forwardemail/superagent

url pdf file with filename attached put request

Open
#1,733 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
16.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

i have a pdf file url. i need to send it with superagent with fileName param. is there example of this?
this is not working

```
const urlf = 'http://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf';

const s = await http.get(urlf, (stream) => {
return stream;
});

let req = superagent
.put(`${url}/attachFile`)
.auth(apiUserName, password)

req.attach('fileName', "dummy.pdf");
req.pipe(s)
.end(() => {
console.log("attachement upload")
})

```

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.