downloadFileFromS3: (res, fileName) => {
const params = { Bucket: process.env.AMZ_BUCKET, Key: fileName } // keyname can be a filename
s3.getObject(params, function (err, data) {
if (err) {
return res.send({ error: err })
}
return res.download(data)
})
},
err:Error [TypeError]:文件名必须为字符串