-2

How to send pdf file path. I have to send below pdf path to open in a new window

res.send(__dirname + '/../assets/public/abc.pdf)Added code snippet

CLICK HERE FOR DETAILED CODE SNIPPET

1 Answers1

0

res.send expects the content to be sent. You're sending a path. If you want to send a document, use res.sendFile instead.

Check out the docs for res.send and notice that you can only use it to send content and not paths.

Also read the docs for res.sendFile.

Besto
  • 388
  • 1
  • 13