配置spring-mvc.xml
<!-- 上传文件配置 2048*1024*1024即2GB resolveLazily属性启用是为了推迟文件解析,以便捕获文件大小异常 --> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <!----> <!--<property name="maxUploadSize" value="2147483648"/>--> <property name="maxUploadSize" value="20480"/> <property name="maxInMemorySize" value="10240"/> <property name="defaultEncoding" value="UTF-8"/> <property name="resolveLazily" value="true"/> </bean>
配置ngnix
server { listen 80; server_name www.xxx.com; location / { client_max_body_size 2048m; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:8081; index index.jsp index.html index.htm; } }
原文地址:https://www.cnblogs.com/L237/p/12331736.html
时间: 2024-10-13 05:43:30