Skip to main content

下载文件

方法#

fs.project.downloadFile(options)

使用#

const {fs} = core // 从core中解构出fs // ... const downRes = await fs.project.downloadFile({ url: '', // 下载的地址, fileName: '', // 保存的文件名, targetDir: '', // 下载到的路径, progress: (percentage, transferred, total) => { // task.output = `正在下载: ${percentage}% ${transferred}/${total}` }})

返回#

类型描述
errnumber下载成功,值为0,其余均为失败
msgstring下载结果的描述
  • 没帮助 0