最简单的下载方法,而且不用考虑出现文件名乱码
var fname = encodeURIComponent(files.fname)(这里的name是带扩展名的:.xls) res.set(‘Content-Disposition’, ‘attachment; filename="’ + fname + ‘" ;filename*=utf-8’’’ + fname) res.sendfile(files.path)
var fname = encodeURIComponent(files.fname)(这里的name是带扩展名的:.xls) res.set(‘Content-Disposition’, ‘attachment; filename="’ + fname + ‘" ;filename*=utf-8’’’ + fname) res.sendfile(files.path)