Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url pdf file with filename attached put request #1733

Open
daskabe opened this issue Jun 29, 2022 · 0 comments
Open

url pdf file with filename attached put request #1733

daskabe opened this issue Jun 29, 2022 · 0 comments

Comments

@daskabe
Copy link

daskabe commented Jun 29, 2022

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")
   })

@daskabe daskabe changed the title url pdf url pdf file with filename attached put request Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant