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

The field imgFile exceeds its maximum permitted size of 1048576 bytes.显示文件的大小超出了允许的范围。

每个文件的配置最大为1Mb,单次请求的文件的总数不能大10Mb。要更改这个默认值需要在配置文件(application.properties)中加入两个配置。

multipart.maxFileSize=10Mb是设置单个文件的大小,
multipart.maxRequestSize=100Mb是设置单次请求的文件的总大小如果是想要不限制文件上传的大小,那么就把两个值都设置为-1就行啦

server:
  port: 9292   #配置启动端口号
  servlet:
    context-path: /aa  #配置启动项目名

spring:
  thymeleaf:
    cache: false
    prefix: classpath:/templates/
    suffix: .html
  servlet:
    multipart: #设置上传文件大小
      enabled: true
      max-file-size: 20MB #设置单个文件的大小
      max-request-size: 20MB #设置单次请求的文件的总大小


  datasource:
    name: test  #数据库名
    url: jdbc:mysql://localhost:3306/dev?useSSL=false&characterEncoding=UTF-8 #url
    username: root  #用户名
    password: root  #密码
    driver-class-name: com.mysql.jdbc.Driver  #数据库链接驱动

  web:
    resources:
      static-locations: classpath:/static/,file:${photo.file.dir} #暴露哪些资源可以通过项目名访问

mybatis:
  mapper-locations: classpath:com/lgqyun/mapper/*.xml
  type-aliases-package: cn.lgqyun.entity

# 日志配置
logging:
  level:
    root: info
    com.baizhi: debug

# 指定文件上传位置
photo:
  file:
    dir: F:/myGit/ems/src/main/resources/static/img
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值