wx.uploadFile一直失败,是url的原因吗?
发布于 4 年前 作者 yangmao 14132 次浏览 来自 官方Issues
              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的原因吗,一直是上传失败。后台也完全没有接到请求。

1 回复
tempFilePaths是数组不是字符串。已解决
回到顶部