Home > Enterprise >  How can get Buffer from already saved PDF in NodeJs?
How can get Buffer from already saved PDF in NodeJs?

Time:01-22

I have to upload the pdf file to Backblaze bucket. which accepts Buffer only. PDF file is already stored in one of my directory. i can access that pdf through fs.

while uploading i have to give buffer. Which is the best way to get buffer?

CodePudding user response:

I found simple way without using Buffer.. I can pass the file path to readFileSync() in fs

Example const buff = fs.readFileSync("pdfs/abcd.pdf")

  •  Tags:  
  • Related