关于使用Sails 1.0下载文件的逻辑

时间:2019-02-14 06:05:54

标签: mysql sails.js

TypeError:

  

CompanyDocs.startDownload不是函数       在Object.download [作为companydocs / download](E:\ Shiva \ pgnode \ api \ controllers \ CompanyDocsController.js:83:43       在process._tickCallback(internal / process / next_tick.js:68:7)

我正在尝试从POSMAN API服务下载文件

下载:

async function({
  docId
}, exists) {
  var file = await CompanyDocs.find({
    docId: docId
  }).limit(1)

  if (!file) {
    throw 'notFound';
  }

  //this.res.attachment(filename.downloadName);

  var downloading = await CompanyDocs.startDownload(CompanyDocs.uploadedFiles);

  return exists.sucess(downloading)
}

0 个答案:

没有答案