I've posted too many questions about this but I keep hitting a wall so I keep asking. Can you send an XLS or XLSX file using Express' res.sendFile()
?
Here's the code I'm using:
res.sendFile(
path.join(__dirname, '../testing/'),
`${fileName}`,
(err, data) => {
if (err) throw err;
}
);
Even though fileName
has the value of filename.xlsx
, it never uses the XLSX file; it always defaults to index.html
. I always get the following error:
[Error: ENOENT: no such file or directory, stat '/Users/username/Documents/app/testing/index.html']