大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全家桶1年46,售后保障稳定
1、ajax
jQuery.ajax({
url: contextUrl + “/accidentAttachment/saveAccidentAttachment”,
type:’post’,
data: formData,
contentType: false,
processData: false,
error: function (XMLHttpRequest, status) {
bootbox.alert(‘上传文件失败!’);
},
2、html
accept=”image/png, image/jpeg, image/gif, image/jpg”
@change=”uploadPic()”>
3、后端代码
@RequestMapping(value = “/saveAccidentAttachment”, method = RequestMethod.POST)
@ResponseBody
public ResponseData saveAccidentAttachment(@RequestParam(“file”) MultipartFile multipartFile, @RequestParam String bizType) {…
4、报错信息
Request URL: http://localhost:8080/accidentAttachment/saveAccidentAttachment
Request Method: POST
Status Code: 400 Bad Request
Remote Address: [::1]:8080
Referrer Policy: no-referrer-when-downgrade
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 153966
Content-Type: multipart/form-data; boundary=—-WebKitFormBoundaryk5RsQTH9ae4jvG4k
Cookie: Webstorm-d6a483d9=0efba8f4-fa39-4a6b-9ac4-4ea22de7ab23; sso.jd.com=TEST.882a88797c4d4771b80d034bc8c327d7; JSESSIONID=ED7C20A5A21F5714B328F97DFD0DFDDC
Host: localhost:8080
Origin: http://localhost:8080
Pragma: no-cache
Referer: http://localhost:8080/accident/detail?id=159&type=edit&_time=1574848776183
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
X-Requested-With: XMLHttpRequest
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/234551.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...