Multipart file maximum size exception - spring boot embbeded tomcat

后端 未结 6 1243
说谎
说谎 2021-01-04 20:03

I have set max file size to

multipart.maxFileSize: 1mb
multipart.maxRequestSize: 1mb

This is my controller :

@RequestMappi         


        
6条回答
  •  北荒
    北荒 (楼主)
    2021-01-04 20:27

    I wrote some lines in application.yml to solve this issue like:

    spring:
        http:
            multipart:
                max-file-size: 10MB
                max-request-size: 10MB
    

    but it didn't solve the problem. However, adding same lines in application.properties after formatting to single liner way i.e. properties file way then it worked.

提交回复
热议问题