以下是pdf缓冲区。我想将缓冲区转换为pdf文件。
data = {
"file": {
"type": "Buffer",
"data": [
102,
24,
62
]
},
}
res.send( data );
答案 0 :(得分:1)
您可以使用export并使用标题发送一些数据。
// res.sendFile(path [, options] [, fn])
let options = {
headers: {
'TheDataYouWantToSend': Date.now() // for example a timestamp
}
}
req.sendFile(absolutePathToFile, options)
我希望这会有所帮助