Here i have demo.jsp page where i have form in that im uploading image file and submitting,after submit it goes to servlethomepage,where i need to get the uploaded image path,how can i get it?Anybody guide me please?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ImageResizing</title>
<script>
function validate() {
if (fileName.length == "") {
alert("Please Select Image");
}
else {
document.getElementById("uploadImgForm").submit();
}
}
</script>
</head>
<body>
<%
out.println("<form method='post' action='Result' enctype='multipart/form-data' id='uploadImgForm' name='uploadImgForm'>");
out.println("<table>");
out.println("<tr><td><input type='file' multiple='multiple' accept='image/*' id='Imgfile' name='Imgfile'></td></tr>");
out.println("<tr><td></td></tr>");
out.println("<tr><td><input type='button' value='Show Images' onclick='validate()'></td></tr>");
out.println("</table>");
out.println("</form>");
%>
</body>
How to get choosen image path in Result Servlet,i.e.,C:\users\Pictures\logo.jpg,help me anybody?