wx.downloadFile仅仅使用如下代码,未设置filePath属性,下载文件为excel文件
开发工具和手机端正常返回值,可以获取xls格式的excel文件
{"tempFilePath":"http://tmp/wx8b028dc4ce21075e.o6zAJs6wqcYV0xemx8m88l0fPi3U.UKiBI48sFRlO309bc07de1e2f959b8f9e96749114fca.xls","statusCode":200,"header":{"Server":"openresty","Date":"Mon, 31 Aug 2020 15:03:45 GMT","Content-Type":"application/vnd.ms-excel","Content-Length":"4608","Connection":"close","Last-Modified":"Mon, 31 Aug 2020 15:03:45 GMT","Accept-Ranges":"bytes","Set-expires=Tue, 31-Aug-21 15:03:45 GMT; max-age=31536000; path=/; version=1"},"cookies":[expires=Tue 31-Aug-21 15:03:45 GMT; max-age=31536000; path=/; version=1"],"errMsg":"downloadFile:ok"}
但是在pc端微信端口进入的小程序返回值为txt的文件与xls文件格式都不一样,导致无法找到缓存文件
wx.downloadFile({
url: url,
success(res) {}
})
{"cookies":["BAEID=07F2CC985DD480633105B86795594080; expires=Tue 31-Aug-21 14:58:18 GMT; max-age=31536000; path=/; version=1"],"header":{"accept-ranges":"bytes","content-length":"4608","content-type":"application/vnd.ms-excel","date":"Mon, 31 Aug 2020 14:58:18 GMT","etag":"\"5f4d100a-1200\"","last-modified":"Mon, 31 Aug 2020 14:58:18 GMT","server":"nginx", expires=Tue, 31-Aug-21 14:58:18 GMT; max-age=31536000; path=/; version=1","status":"200"},"statusCode":200,"tempFilePath":"wxfile://temp/15.txt","errMsg":"downloadFile:ok"}
请具体描述问题出现的流程,并提供pc微信版本号、能复现问题的简单代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html