wx.uploadFile 上传大视频报错,请问api是否做了限制,如果限制了大小是多少?
发布于 7 年前 作者 chaowu 14950 次浏览 来自 问答
错误提醒: uploadfile: fail connection reset 

wx.chooseVideo({
      compressed:false,
      success(res) {
       console.log(res)
        var tempFilePath = res.tempFilePath
        var postData = {
          'tempName': tempFilePath
        }
        const uploadTask = wx.uploadFile({
          url: "http://10.21.28.105/api" + '/VideoUpload/UpladFile',
          filePath: tempFilePath,
          name: 'file',
          formData: postData,
          success: function (res) {
            console.log(res)
           
          },
          fail: (f) => {
            console.log('uploadVideo2/fail')
            console.log(f)
          }
        })
        //更新进度条
        uploadTask.onProgressUpdate((res) => {
          that.setData({
            percent: res.progress
          })

        })
      },
      fail: (f) => {
        console.log('VideoUpload/fail')
        console.log(f)
      }
    })
3 回复

我这里上传245M的视频,用IOS相机拍摄的2分12秒的视频,都可以上传的。我以前也遇到过,需要检查一下nginx或apache的上传限制,nginx的默认限制好像是32M

你的服务有问题吧

回到顶部