码上敲享录 > SpringBoot常见问题详解 > The field file exceeds its maximum permitted size of 1048576 bytes.

The field file exceeds its maximum permitted size of 1048576 bytes.

上一章章节目录下一章 2020-05-09已有2384人阅读 评论(0)

The field file exceeds its maximum permitted size of 1048576 bytes.


解决方法:

Caused by: java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 1048576 bytes.

因为springboot默认每个文件的配置最大为1Mb,单次请求的文件的总数不能大于10Mb


可以在application.yml配置文件中上传文件大小限制,我的springboot版本是1.5.8.RELEASE

spring:

    http:

        multipart:

           max-file-size: 100Mb

              max-request-size: 500Mb



向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交