wx.cloud.downloadFile下载的文件内容没有更新

发布于 7 年前作者 hliang13641 次浏览最后编辑 7 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

  • 预期表现

  • 复现路径

  • 提供一个最简复现 Demo

 

let fileId = await cloud.uploadFile({

    cloudPath: fileName,

   fileContent: fileData

  })

通过上述方法保存文件到云存储

wx.cloud.downloadFile({

          fileID: res.result.fileID, // 文件 ID

          success: res => {

            // 返回临时文件路径

            console.log(res.tempFilePath)

            var fileSystemManager = wx.getFileSystemManager()

            fileSystemManager.saveFile({

              tempFilePath: res.tempFilePath,

              success: res => {

                console.log(“savedFilePath:”, res.savedFilePath)

                wx.hideLoading()

                wx.openDocument({

                  filePath: res.savedFilePath,

                  fileType: ‘xlsx’,

                  success: res => {

                    console.log(‘打开文档成功’)

                  }

                })

              },

              fail: res => {

                wx.hideLoading()

                console.log(res.errMsg)

              }

            })

          },

          fail: res => {

            wx.hideLoading()

          }

        })

      }

然后在客户端下载文件并打开,文件内容没有更新为最新写入的内容

0 回复
暂无回复