文件上传可以直接使用Commons-FileUpload实现,它提供对文件操作的强大和高性能的封装。
引入依赖。
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
原创大约 3 分钟