上次传图片接口调用失败,不能超过最大连接数10
发布于 6 年前 作者 xiulan33 12943 次浏览 来自 问答

小程序文件上传,提示文件上传失败,报错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("完成")
            }
        })
    },

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

1 回复

怎么解决的

回到顶部