html52.com
我爱小程序-开发者交流社区

wx.uploadFile一直失败,是url的原因吗?

              wx.uploadFile({
                url: 'http://localhost:8080/xxx/v1/feedback',
                filePath: tempFilePaths,
                name: 'file',                
                header: {
                  'Content-Type': 'multipart/form-data',
                  'accept': 'application/json',
                },
                success:function(res){
                  console.log("上传成功");
                },
                fail:function(res){
                  console.log("上传失败");
                }
              })

filePath调试可以看到没问题,是url的原因吗,一直是上传失败。后台也完全没有接到请求。

网友回复

Ko.24:
tempFilePaths是数组不是字符串。已解决


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付