Idea、SpringBoot、Maven
本文参考:https://blog.csdn.net/weixin_43160956/article/details/84675286
1.添加依赖
<!-- 文件上传和下载-->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2.创建一个类
package com.example.demo1.FileUpDo;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax