电光石火-穿越时空电光石火-穿越时空


springboot使用MultipartFile文件上传

SpringBoot 2.0版本

spring:
  servlet:
    multipart:
    enabled: true #默认支持文件上传
    file-size-threshold: 0 #文件写入磁盘后的阈值。值可以使用后缀"MB"或"KB"分别表示兆字节或千字节
    location: #上传文件的中间位置
    max-file-size: 10Mb #单个文件限制
    max-request-size: 50Mb #请求总文件大小限制

SpringBoot1.5版本

spring:
  http:
    multipart:
    enabled: true #默认支持文件上传
    file-size-threshold: 0 #文件写入磁盘后的阈值。值可以使用后缀"MB"或"KB"分别表示兆字节或千字节
    location: #上传文件的中间位置
    max-file-size: 10Mb #单个文件限制
    max-request-size: 50Mb #请求总文件大小限制

配置需要放置bootstrap.yml不然不生效

本博客所有文章如无特别注明均为原创。作者:似水的流年
版权所有:《电光石火-穿越时空》 => springboot使用MultipartFile文件上传
本文地址:http://www.ilkhome.cn/index.php/archives/320/
欢迎转载!复制或转载请以超链接形式注明,文章为 似水的流年 原创,并注明原文地址 springboot使用MultipartFile文件上传,谢谢。

评论