如何使用Servlet上传文件?

时间:2013-12-04 20:01:57

标签: html jsp servlets file-upload java-server

我的HTML代码是:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="UploadServlet" method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<p>After submitting such a form the binary multipart form data is available in the HttpServletRequest#getInputStream()</p>
<input type="submit" />
</form>
</body>
</html>

之后我想把这个文件显示为另一个页面上的帖子,所以也帮助我。

0 个答案:

没有答案