1. 先写一个html页面用来上传表单
我使用了一点thymeleaf,不了解无视即可。上传多文件和单文件都是用
file
类型提交,多文件需要指定为multiple
,接受时指定参数类型即可。
<!--upload.html-->
<!DOCTYPE html>
<html lang="en"xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form role="form" method="post" th:action="@{/upload}"
enctype="multipart/form-data">
email:<input type="