function openFileByUrl(url){
console.log(‘url=’+url);
this.showLoading();
var hearder = getHeader(url);
console.log(hearder);
wx.downloadFile({
url: url,
header: hearder ,
success: function (res) {
console.log(res);
var filePath = res.tempFilePath;
console.log(‘filePath===’+filePath);
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log(‘打开文档成功’)
},
fail:function(err){
alert(err.errMsg);
}
})
},
complete:function(){
console.log(‘compleate’);
wx.hideLoading();
}
})
}
安卓手机下载附件(不管是doc,还是pdf)后缀名变成了.htm。然后打开就报:fail file type not supported 2003,ios下正常。
请问什么问题?感谢