收藏
回答

上次传图片接口调用失败,不能超过最大连接数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("完成")
            }
        })
    },

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

最后一次编辑于  2017-03-24  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏关注问题回答

1 个回答