上传图片失败
发布于 6 年前 作者 luoxiuying 4231 次浏览 来自 问答

上传的时候调用接口报错:uploadFile:fail Error: getaddrinfo ENOTFOUND

实际代码:

takePhoto:function(){

wx.createCameraContext().takePhoto({

success:function(res){

console.log(res.tempImagePath)

wx.uploadFile({

url: app.globalData.url + ‘bc_manager/member/uploadImage.do’,

filePath:res.tempImagePath,

name: ‘file’,

header: {

‘content-type’: ‘multipart/form-data’

},

success: function (res) {

var date = JSON.parse(res.data)

console.log(date.obj.filePath);

},

})

}

})

},

1 回复

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部