Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem that the springboot uploaded file is too big to report an error?

Shulou Source: shulou.com Published: 2022-06-01 01:03:08 09月12日 Update

This article is a small series for everyone to introduce in detail "how to solve the problem of too big an error in springboot uploading files". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to solve the problem of too big an error in springboot uploading files" can help you solve your doubts. Let's go deeper and learn new knowledge together with the ideas of the small series.

1. Springboot 2.1.0 uploads files that are too large and reports an error

Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (216185201) exceeds the configured maximum (104857600)

2. Treatment scheme:

1. Check whether Nginx has a limit on the size of the request data

server {

listen 80;

#server_name localhost;

client_max_body_size 500M;

#charset koi8-r;

#access_log logs/host.access.log main;

location /test/ {

proxy_pass http://127.0.0.1:8080/test/;

}

}

where: client_max_body_size 500M; required to open, release restrictions

3. See if tomcat has a limit on the requested data size

In D:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\server.xml

maxPostSize Sets the request size,-1 means unlimited

4. springboot sets request size limits

Configure in application.properties:

spring.servlet.multipart.max-file-size=500MB

spring.servlet.multipart.max-request-size=500MB

Read here, this article "springboot upload file too big error how to solve" article has been introduced, want to master the knowledge point of this article also need to practice before you can understand, if you want to know more related content of the article, welcome to pay attention to the industry information channel.

Tags: Restrictions big reports files size articles content data processing proper representatives ideas new knowledge solutions more steps knowledge knowledge points articles details industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia vpn MariaDB Shulou Information