收藏
回答

wx.uploadfile调用失败socket hang up?

wx.chooseImage({
      count1,
      sizeType: [
        'original',
        'compressed'
      ],
      sourceType: [
        'camera'
      ],
      success(res) {
        const tempFilePaths = res.tempFilePaths
        wx.uploadFile({
 
          url"xxxxxxxxxxxxxxxxxxxx", 
          filePath:tempFilePaths[0],
          name'filename',
          method'post',
 
          successfunction (res{
            console.log(res);
          },
          failfunction (res{
            console.log("上传失败");
            console.log(res);
          }
        })
      },
      fail(err){
        console.log(err,"---")
      }
    })



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

3 个回答

登录 后发表内容