wx.downloadFile怎么下载64位文件?

小程序 文章 2021-03-17 15:01 596 0 全屏看文

AI助手支持GPT4.0

wx.downloadFile怎么下载64位文件?How does wx.downloadFile download 64-bit files?

wx.downloadFile怎么下载64位文件?

后台返回的文件是64位的,要怎么使用wx.downloadFile下载并通过wx.openDocument打开文档呢?

The file that the backstage returns is 64 bit, how to use wx.downloadFile Download and pass wx.openDocument How about opening the document?

回答:

少侠:

文档链接:https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html


用fs.writeFile写入base64到本地,会得到一个本地路径,然后用wx.openDoucment去打开

😮😮:

我之前这样写过 保存在本地: wx.getFileSystemManager().writeFile .... 然后拿到本地路径再打开 wx.openDocument 可以试试看

11110111001011110111001110111:

wx.openDocument打开的文件格式是有要求的,不符合格式要求无法打开


-EOF-

AI助手支持GPT4.0