6***@qq.com
6***@qq.com
  • 发布:2023-12-14 09:49
  • 更新:2023-12-14 09:53
  • 阅读:234

uni.uploadFile上传多个文件,报错uploadFile:fail createUploadTask:fail file not found

分类:uni-app

请求代码

 uni.uploadFile({  
    url: `${baseUrl}/logistics/raw/seal/commit`,  
    name: 'files',  
    formData: params,  
    filePath: '',  
    files: images,  
    header: {  
      Authorization: 'Bearer ' + token,  
    },  
    success: (res) => {  
      console.log(res)  
    },  
    fail: (err) => {  
      console.log(err)  
    },  
  })

images 里面的数据

let file = {  
      name: 'images' + index,   
      uri: element.uri, //"http://tmp/szyutwQlJeHjb25b5599c3ff6abaf6cccc7354477795.png"  
    }  
    images.push(file)
2023-12-14 09:49 负责人:无 分享
已邀请:
套马杆的套子

套马杆的套子 - 没有解决不了的问题,只有解决不完的问题

单个的用filePath试试会有这个问题么?

  • 6***@qq.com (作者)

    单个可以,我看了下,是不是因为微信小程序的不支持多文件上传?

    2023-12-14 10:11

  • 套马杆的套子

    回复 6***@qq.com: 小程序啊。那是不支持,files只支持app和H5

    2023-12-14 10:48

要回复问题请先登录注册