This was jsp file uploading form
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>File Uploading form</title>
</head>
<body>
<form action="./read.do" method="post">
Select the file to read: <input type="file" id="myFile" size="50">
<br />
path is: <input type="text" name="path" />
<button type="button" onclick="myFunction()">Copy path</button>
<input type="submit" value="Submit">
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myFile").value;
document.getElementsByTagName("INPUT")[3].setAttribute("value",x);
}
</script>
</form>
</body>
</html>
Here i was not uploading the file to my server i was just taking the path of the file and reading the file using following code in servlet
String path = req.getParameter("path");
FileInputStream fis = null;
File excel = new File(path);
fis = new FileInputStream(excel);
this works fine when i run on same machine where server is present .But when i try to access from other machine the code is searching the path in my machine but not on client machin how to over come this. I have seen some other ways like using multipart but there the file is loading to server but for my requirement i should not upload the file directly to my server i have to read the complete file on client machine it self by taking the file path . Please suggest me some ideas to attain this