springMvc配置
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
<property name="defaultEncoding" value="utf-8"></property>
<property name="maxUploadSize" value="5242880000"/> <!--设置上传文件大小限制-->
</bean>
tomcat 设置server.xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" maxPostSize="-1"/>
设置connectionTimeout,防止上传超时
设置maxPostSize -1,代表上传大小不做限制(tomcat 8.5.x)