【发布时间】:2020-03-17 08:04:40
【问题描述】:
我试图弄清楚,是否可以创建一个文件而不将其存储在驱动器中,仅用于在 POST 请求中立即下载它。
const specialRequests = async (req, res, next) => { // POST request
... // processing
let xmlString = ... // get processed xml string
// create xml file from that xmlString
// initialise download of the file, dont save it
let file = ???
res.download(file);
};
如果可能的话怎么做
【问题讨论】:
标签: javascript node.js express download