Sails startDownload not working - TypeError: sails.startDownload is not a function

Sails startDownload not working - TypeError: sails.startDownload is not a function

我关注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

Sails 版本 1.1.0

你安装了吗sails-hook-uploads as mentioned in the documentation你已经链接到?