Spring boot parent version = 2.6.3

I wrote the following in the config server file, but it didn't work.

spring.servlet.multipart.max-file-size=**10MB**
spring.servlet.multipart.max-request-size=**10MB**

I defined custom beans but again it didn't work.

@Bean
public MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    factory.setMaxFileSize("124MB");
    factory.setMaxRequestSize("124MB");
    return factory.createMultipartConfig();
}

I tried with version 2.2.2, it works, but I tried with version 2.6.3, it didn't work. Could something have changed in the new version? I am trying to run the application in Cloud Foundry environment. But I am getting error. I don't get any error in local environment.

Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 1048576 bytes.

Comment From: pruidong

In the documentation, Your configuration is valid.

You can try to make the configuration size bigger:

spring.servlet.multipart.max-file-size=100MB spring.servlet.multipart.max-request-size=100MB

if you want to specify that files be unlimited, set the spring.servlet.multipart.max-file-size property to -1.

Spring Boot will automatically configure the relevant beans.

Comment From: wilkinsona

@sehmusaydogdu I can't spot anything from what you have described thus far that would cause the problem. It's possible that you have some configuration in Cloud Foundry – environment variables, for example – that's overwriting your configuration or preventing the configuration from being picked up. However, that wouldn't explain why it apparently worked with 2.2.x and does not work with 2.6.x.

If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

Comment From: Vishnus0

@sehmusaydogdu @spring-projects-issues was a solution for this found?