标签:
@RequestMapping("/insertOrder")
@ResponseBody
public Object insertOrder(String userId,HttpServletRequest req) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; // 获得文件: MultipartFile file = multipartRequest.getFileMap();
}
********************************************************************************************
jsp中的form表单的enctype必须附带
<
form
action
=
"/api/v1.0/tests/testfile"
httpMethod
=
"post"
enctype
=
"multipart/form-data"
>
<
input
type
=
"file"
name
=
"testfile"
/>
<
button
type
=
"submit"
>提交</
button
>
</
form
>
SpringMVC在上传文件的时候提示The current request is not a multipart request错误
标签:
原文地址:http://www.cnblogs.com/sily-boy/p/4647690.html