L237
 

  配置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; //设置文件上传最大限制 2G
            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;  
        }  
    } 
    

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
猜你喜欢
  • 2021-11-20
  • 2022-02-10
  • 2021-11-20
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案