downloadFile下载文件没有后缀名 如何解决

发布于 4 年前作者 qinjing1493 次浏览最后编辑 4 年前来自 share

wx.downloadFile({

      url: e.currentTarget.dataset.url,

      success: function (res) {

        const fileManager = wx.getFileSystemManager()

        const filePath = wx.env.USER_DATA_PATH + '/xxxx.xlsx'

        fileManager.saveFile({

          tempFilePath: res.tempFilePath,

          filePath,

          success: () => {

            wx.openDocument({

              filePath: filePath,

              showMenu: true,

              fileType: 'xlsx'

            })

            wx.hideLoading()

          }

        })

      }

    })

0 回复
暂无回复