uni.uploadFile({
url: '***', //接口地址
filePath: tempFilePaths[0],
name: 'file',
formData: {
'width': 80,
'height': 80,
dir: 'user',
'oldPath': '',
},
success: (res) => {
console.log(res);
}
});
小程序可以上传成功,在浏览器打开h5和在微信直接打开链接的h5都不能上传成功,返回的错误是uploadFile:fail
d***@163.com (作者)
打印出来的tempFilePaths是以blob开头的一个地址;blob:https://域名/fc6cd1f7-f88c-4c11-a081-8bc8353e6557
2023-01-10 14:50