I'm trying to read a PDF that is on my server-side storage, and upload it to a database
So, first I tried to read it with fs.readFileSync():
let file = fs.readFileSync(route)
// returns <Buffer 25 50 44 46 2d 31 2e...
Then, I tried to convert it to a Blob
let blob = new Blob([file], {type:"application/pdf"})
It worked, but it returned an empty pdf file.
I tried to convert it to a File too, but I had the same results:
let blob = new File([file], "file.pdf", {type:"application/pdf"})
What am I doing bad?