<?xml version="1.0" encoding='utf-8'?>

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="application/vnd.wap.xhtml+xml;charset=UTF-8"/>

<title>文件上传</title>
</head>
<body>
<form name="form1" method="post" action="up.jsp" enctype="multipart/form-data">
密码:<input type="text" name="pass"/><br/>
<input type="file" name="file1"/>
<input type="submit" name="submit" value="· 提交 ·"/>
</form>
</body>
</html>

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="application/vnd.wap.xhtml+xml;charset=UTF-8"/>
<title>文件上传</title>
</head>
<body>
<form name="form1" method="post" action="up.jsp" enctype="multipart/form-data">
密码:<input type="text" name="pass"/><br/>
<input type="file" name="file1"/>
<input type="submit" name="submit" value="· 提交 ·"/>
</form>
</body>
</html>
本文展示了一个简单的文件上传表单HTML代码实例,该表单允许用户输入密码并选择文件进行上传。表单使用POST方法提交,并指定enctype属性为multipart/form-data以便正确处理文件数据。
972

被折叠的 条评论
为什么被折叠?



