如何解决wx.cloud.downloadFile “empty download url”的问题?

发布于 9 年前作者 zhuyang13745 次浏览最后编辑 9 年前来自 issues
   onPreviewDocumnet: function (e{
      const fileID = e.detail.value;
     console.log(encodeURI(fileID)) 
   const that = this;
    wx.cloud.downloadFile({
      fileID: fileID
    }).then(res => {
      console.log(res);
      const filePath = res.tempFilePath
      wx.openDocument({
        filePath: filePath,
        successfunction (res{
          that.setData({
            showDocumentListfalse
          })
        }
      })
    }).catch(error => {
      console.log(error);
    })

调用 一下 wx.cloud.getTempFileURL api 之后就可以了,一定要每次下载都获取下载地址?那这个 wx.cloud.downloadFile 传入fileID有什么用呢?不解


1 回复
fang59
fang591 楼6 年前

你不获取下载地址,谁知道要下载哪个?