UNIAPP使用uni.uploadFile上传文件时后端提示错误 : “No multipart boundary param in Content-Type”
解决方案
去掉 “content-type”: “multipart/form-data”,H5使用浏览器自己自动生成boundary即可
uni.uploadFile({
url,
filePath,
name,
formData: {
moduleCode,
},
// #ifndef H5
header: {
'content-type': 'multipart/form-data',
},
// #endif
success: (res) => {
console.log(res)
}
})