How can I upload a file using a Servlet?

72 views Asked by At

My HTML code is:

<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>

afterwards I want to get this file displayed as a post on another page, so help me with that as well.

0

There are 0 answers