wx.upload ios手机可正常上传,安卓手机无法上传文件?
发布于 6 年前 作者 osong 11996 次浏览 来自 问答
 

x.uploadFile({
      url'https://xxx'//这里的'temp/'是在环境中创建的文件夹
      filePath: sourcePath,   
      name'file',
      header: {
        "Content-Type""multipart/form-data"
      },
      success: function (res) { 
        })
      },
    })



filepath 是用 chooseMessageFile 获取到的临时路径 wxfile://.....

ios可直接上传,安卓点击上传无反应,有没有遇到类似问题的,求解答



1 回复

已解决,sourcePath为临时变量,upload函数安卓系统不能获取路径

回到顶部