我正在关注https://sailsjs.com/documentation/reference/response-res/res-attachment
我的代码如下:
let file = require('path').resolve(document.path)
if (fs.existsSync(file)) {
this.res.attachment(document.name)
let downloading = await sails.startDownload(document.fsPath)
return exits.success(downloading)
}
退出:
exits: {
success: {
statusCode: 200,
description: 'Document has been sent for download.'
},
}
我遇到错误
TypeError: sails.startDownload is not a function
风帆版本1.1.0