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>

 

posted on 2017-07-26 22:25  不好说  阅读(22772)  评论(0编辑  收藏  举报

导航