Reputation: 111
Following is the pdf buffer. I want convert buffer to pdf file.
data = {
"file": {
"type": "Buffer",
"data": [
102,
24,
62
]
},
}
res.send( data );
Upvotes: 1
Views: 4487
Reputation: 437
You can use res.sendFile and use the header to send some data along.
// res.sendFile(path [, options] [, fn])
let options = {
headers: {
'TheDataYouWantToSend': Date.now() // for example a timestamp
}
}
req.sendFile(absolutePathToFile, options)
I hope this helps
Upvotes: 2