微信小程序下载文件格式为bin格式,请问是什么原因呢?
wx.downloadFile({
url: e.currentTarget.dataset.url,
success: (res) => {
console.log(res)
let tempFilePath = res.tempFilePath;
wx.openDocument({
filePath: tempFilePath
})
},
fail: () => { },
complete: () => { }
});
微信小程序下载文件格式为bin格式,请问是什么原因呢?
wx.downloadFile({
url: e.currentTarget.dataset.url,
success: (res) => {
console.log(res)
let tempFilePath = res.tempFilePath;
wx.openDocument({
filePath: tempFilePath
})
},
fail: () => { },
complete: () => { }
});
1 个回答
https://developers.weixin.qq.com/community/develop/doc/0002ec48848808152fdbbb3325b800
wx.downloadFile({
url: e.currentTarget.dataset.url,
header:{"Content-Type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
success: (res) => {
console.log(res)
let tempFilePath = res.tempFilePath;
wx.openDocument({
filePath: tempFilePath
})
},
fail: () => { },
complete: () => { }
});
wx.downloadFile({
url: e.currentTarget.dataset.url,
header:{"Content-Type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
success: (res) => {
console.log(res)
let tempFilePath = res.tempFilePath;
wx.openDocument({
filePath: tempFilePath
})
},
fail: () => { },
complete: () => { }
});