uni.uploadFile({
            url: 'https://www.example.com/upload', //仅为示例,非真实的接口地址
            filePath: tempFilePaths[0],
            name: 'file',
            formData: {
                'user': 'test'
            },
            success: (uploadFileRes) => {
                console.log(uploadFileRes.data);
            }
        });

  跟官网一样,不能设置header的content-type,不然会破坏结构

相关文章:

  • 2021-09-08
  • 2021-11-25
  • 2021-12-03
  • 2021-08-01
  • 2021-12-29
  • 2021-10-11
  • 2021-05-25
猜你喜欢
  • 2021-12-12
  • 2021-12-12
  • 2021-12-18
  • 2021-11-20
  • 2022-01-08
  • 2021-12-01
  • 2022-01-08
  • 2022-01-01
相关资源
相似解决方案