Download, customize the temporary file directory name, and then open it again.
Wx. downloadFile({url: 'https://xxx.cn/sfxy.docx', // for example only, not a real resource filePath: Wx.env. USER_DATA_PATH + '/ this is a custom capture.docx ', success(res) {console.log('========0', res) wx.openDocument({filePath: Res.filepath, success: function (res) {console.log(' open file successfully ')}})Copy the code
Effect: