Current request is not a multipart request
Posted 不好说
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Current request is not a multipart request相关的知识,希望对你有一定的参考价值。
1. 文件上传需要在form表单中添加<form enctype="multipart/form-data">
2. SpringMVC默认是关闭fileupload功能的,开启该能够并验证文件上传:
需要在applicationcotent.xml中做如下配置:
文件上传
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="maxUploadSize" value="100000"/> <property name="maxInMemorySize" value="10240" /> </bean>
或需要在web.xml的servlet中做最大文件上传配置
<multipart-config> <max-file-size>10000000000</max-file-size> </multipart-config>
以上是关于Current request is not a multipart request的主要内容,如果未能解决你的问题,请参考以下文章
axios上传文件错误:Current request is not a multipart request
文件上传功能报错Current request is not a multipart request
解决springMVC文件上传报错: The current request is not a multipart request
JAVA错误提示:The operation is not applicable to the current selection.Select a field which is not declar
Debug出现的问题The origin server did not find a current representation for the target resource or is not
The request lifetime scope cannot be created because the HttpContext is not available