一、遇到问题
需求是在上传之前要求识别图像。 所以需要手动上传图像,但存在以下问题
1 .否bou nry
2 .文件is not present
3.failedtoparsemultipartservletrequest; nestedexceptionisjava.io.io exception : org.Apache.Tomcat.util.http
最后上传失败了。
然后刚开始看别人写的东西,结果不行。 之后,研究了一波。 用以下方法就可以了
1.
u-uploadref=' u upload5' : action=' define.base URL '/API/change power/ocr/v1/vhiclelicense ' ' max-count
2 .提醒我上传前的事件不要填写内容类型和格式数据
asyncbeforeupload(index,list ) uni.uploadfile ) ) URL : this.define.base URL (/API/file/uploader /标致羽毛), header : {//' content-type ' : ' multipart/form-data ', this . success3360(res ) ) console.log (请求成功___________,RES )、故障3360 () ) err ) )。
filepath可以直接使用回调参数。
name:的默认值为file。 如果后端接收文件的名称不同,请更换
header:需要填写你的token等信息。