1

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?

Varun Deva
  • 51
  • 1
  • 9

1 Answers1

3

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

Varun Deva
  • 51
  • 1
  • 9