前台:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<%@ page language=
"java"
contentType=
"text/html; charset=utf-8"
pageEncoding=
"utf-8"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
>
<html>
<head>
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<title>Insert title here</title>
</head>
<body>
<form name=
"serForm"
action=
"/SpringMVC006/fileUpload"
method=
"post"
enctype=
"multipart/form-data"
>
<h1>采用流的方式上传文件</h1>
<input type=
"file"
name=
"file"
>
<input type=
"submit"
value=
"upload"
/>
</form>
<form name=
"Form2"
action=
"/SpringMVC006/fileUpload2"
method=
"post"
enctype=
"multipart/form-data"
>
<h1>采用multipart提供的file.transfer方法上传文件</h1>
<input type=
"file"
name=
"file"
>
<input type=
"submit"
value=
"upload"
/>
</form>
<form name=
"Form2"
action=
"/SpringMVC006/springUpload"
method=
"post"
enctype=
"multipart/form-data"
>
<h1>使用spring mvc提供的类的方法上传文件</h1>
<input type=
"file"
name=
"file"
>
<input type=
"submit"
value=
"upload"
/>
</form>
</body>
</html>
==============================================================================================================================
配置:
后台: 方式一:
方式二:
方式三:
|