开发者

How to pass the location of a file from JSP Form to Java Program

String fileToBeRead = "C:/Documents and Settings/Developer/Desktop/Anand exmps/Anand.xls";

I have completed a 开发者_开发百科java program in which the location of a file is assigned to a string as above.

But what actually is required is, the end user should select the location of file in a JSP form that is developed using <input type="file" name="file"/> tag for file selection.

My query here is how can I make the location of the file that the user selects in the JSP form to be passed to the JAVA program that I have written already.

Gimme some ideas regarding the same. Thanks in advance. Since am a beginner in Java, elaborate answers will really help in my procedings.


The input field's file type is not guaranteed to pass the entire path. In fact, IE is the only browser that does.

The file input is intended to upload the entire file to the server, not to give you the file's path.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜