Spring upload file size limit

后端 未结 3 1814
被撕碎了的回忆
被撕碎了的回忆 2020-12-19 03:58

I\'m using Spring Boot for my application, and I want to upload some files into my database. I used a tutorial to achive this, and it works fine. My problem is that I don\'

相关标签:
3条回答
  • 2020-12-19 04:07

    This configuration worked for me:

    spring.servlet.multipart.max-file-size=10MB
    spring.servlet.multipart.max-request-size=10MB
    
    0 讨论(0)
  • 2020-12-19 04:10

    With Spring earlier than 4.0 the right properties are

    multipart.maxFileSize

    multipart.maxRequestSize

    From Spring 4 these were changed to

    spring.http.multipart.max-file-size

    spring.http.multipart.max-request-size

    0 讨论(0)
  • 2020-12-19 04:10

    For me worked (in Spring Boot 2.0.0):

    spring.servlet.multipart.max-file-size=-1
    
    0 讨论(0)
提交回复
热议问题