0

I tried uploading files to the server deployed in azure web app service. In local it's working fine and when it comes to azure it throwing some exception. FileSizeLimitExceededException.

This upload service is developed in JAVA Spring boot version 1.5.8

Could not parse multipart servlet request; 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

spring:
  http:
    multipart:
      max-file-size: 10MB
      max-request-size: 100MB
      enabled: true

Also tried some @Bean entity configuration also. It doesn't help me out.

Tried web.config with custom server.xml file specifying maxPostSize.

I need to set the maximum upload limit to 10MB.

1
  • Is there the SnakeYAML library on your classpath? Commented Mar 27, 2019 at 15:38

1 Answer 1

0

I see you were using application.yml instead of application.properties as the configuration file for your spring-boot app. However, I'm worried about there is not a application.properties file in your project. And as the section [24.6 Using YAML instead of Properties]1 of the Spring offical document for version 1.5.8 said,

YAML is a superset of JSON, and as such is a very convenient format for specifying hierarchical configuration data. The SpringApplication class will automatically support YAML as an alternative to properties whenever you have the SnakeYAML library on your classpath.

[Note] If you use ‘Starters’ SnakeYAML will be automatically provided via spring-boot-starter.

Therefore, there must be a SnakeYAML library in your project, whatever directly add a jar file or configure the maven pom.xml file, if without application.properties.

Sign up to request clarification or add additional context in comments.

1 Comment

My problem has been sorted out by configuring the property file. Thanks for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.