收藏
回答

请教:安卓手机wx.downloadFile下载文件后缀名.htm打开错误

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下正常。

请问什么问题?感谢



回答关注问题邀请回答
收藏

2 个回答

  • 晨曦👻
    晨曦👻
    2019-05-31

    请问问题解决了么,我也碰到类似问题了,docx 文件下载之后变成.jpeg文件,预览的时候就报错,文件类型不支持

    2019-05-31
    有用
    回复
  • ㅤㅤㅤㅤㅤ
    ㅤㅤㅤㅤㅤ
    2018-09-19

    您好,请问你的问题解决了吗,有什么好的建议吗?我也遇到这个问题了

    2018-09-19
    有用
    回复
登录 后发表内容