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

上次传图片接口调用失败,不能超过最大连接数10

问题模块
API和组件

小程序文件上传,提示文件上传失败,报错errMsg:"uploadFile:fail exceed max upload connection count 10"

微信这个下载接口是多线程的么?

我就一个上传一张图片,为什么超过最大并发数

chooseImg: function () {
        var that = this;
        wx.chooseImage({
            count: 1,
            sizeType: ['compressed'],
            sourceType: ['album', 'camera'],
            success: function (res) {
                that.upload(res.tempFilePaths[0]);
            },
        })
    },
    upload: function (path) {
        wx.uploadFile({
            url: 'https://xxxx/api/car/upload-car-image',
            filePath: path,
            name: 'car_image',
            header: { 'content-type': 'multipart/form-data' },
            formData: {
                'attach_attr': 1
            },
            success: function (res) {
                // success
                console.log("成功")
                console.log(res.data)
            },
            fail: function (res) {
                // fail
                console.log("失败", res)
            },
            complete: function () {
                // complete
                console.log("完成")
            }
        })
    },

根本都没有连接服务器,就直接报错了

网友回复

张平:

怎么解决的

评论 抢沙发

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

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

云免签H5支付