Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Linux
I want to get the location of an input file but I can only get the name of the image

JSP
<form action="Uploader" method="post">
   <input type="file" name="imageFile" />
   <input type="submit" value="Upload" />
</form>


(Example the location of the file is C:\Program Files\AVG\AVG9\image.gif)

Servlet
String path = request.getParameter("imageFile");
System.out.println(path);


When I print the path it only display the name of the file which is image.gif
Posted
Updated 26-Jul-10 23:22pm
v5

1 solution

first your form need be multi-parts, second try to use apache upload file for not do a hard work! http://commons.apache.org/fileupload/ ^_^
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900