I'm getting error while uploading excel file size is more the 1MB.
[org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request;
nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException:
The field files exceeds its maximum permitted size of 1048576 bytes.]
I tried to fix it by applying the following config changes but none of them help me.
Try with configuration in application.yml
file :
spring:
http:
multipart:
max-file-size:5MB
max-request-size:5MB
And also I've tried the below annotation:
@MultipartConfig(fileSizeThreshold=1024*1024*10,maxFileSize=1024*1024*10,maxRequestSize=1024*1024*10)
And last I made this change:
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" maxSwallowSize="-1" />
But nothing does work !
spring.http.multipart.max-file-size
, notSpring.http.multipart.max-file-size
. – Shults