我无法将字符串缓冲区保存为文件并将其发送,因为我使用的是弹性beanstalk。我只是有一个字符串,我需要用户可以将其下载为xml文档。
router.get('/', (req, res) => {
let xml = `<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>`;
//What next?
});
答案 0 :(得分:1)
将内容处置标题添加为附件,将内容类型添加为xml
Content-Disposition: attachment