上传文件过大时,不会进入控制层,会直接抛出异常,提示上传文件过大,如下:

org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (230405130) exceeds the configured maximum (104857600)


spring-mvc.xml文件中的配置信息限制了上传文件的大小,如下:

<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
p:defaultEncoding="UTF-8">
<property name="maxUploadSize">
<value>104857600</value>
</property>
<property name="maxInMemorySize">
<value>4096</value>
</property>
</bean>