meteor-rest
meteor-rest copied to clipboard
Problem with `res.send` to download file?
trafficstars
I use XlsxPopulate to generate and download XLSX file.
In example to download with Express
router.get("/download", function (req, res, next) {
// Open the workbook.
XlsxPopulate.fromFileAsync("input.xlsx")
.then(workbook => {
// Make edits.
workbook.sheet(0).cell("A1").value("foo");
// Get the output
return workbook.outputAsync();
})
.then(data => {
// Set the output file name.
res.attachment("output.xlsx");
// Send the workbook.
res.send(data);
})
.catch(next);
});
I tried in simple:json-routes, but don't work
Did you get anywhere with this? I'll need to do something similar.
still have problem