SpringBoot访问静态资源+文件上传

一,访问静态资源

1.  SpringBootclasspath/static的目录

注意目录名称必须是static

 

 

 

 

1.  ServletContext根目录下

src/main/webapp  目录名称必须要webapp

 

 

 

一,文件上传

1.   编写Controller

 

 

2   编写启动类

 

3.   设置上传文件大小的默认值

 

需要添加一个springBoot的配置文件

 

application.properties

 

 

设置单个上传文件的大小

spring.http.multipart.maxFileSize=200MB

设置一次请求上传文件的总容量

spring.http.multipart.maxRequestSize=200MB

 

 

 

 

posted @ 2019-12-09 10:06  李jojo  阅读(570)  评论(0编辑  收藏  举报