Need to provide a dialog box for the user to select a file in jsp

i have a jsp file [which executes a XSL transformation] and need to provide a dialog box so that the user can select the input xml file on which the xsl transformation can be done. How to do it jsp? And the file which will be selected will be in the server...
emsenthilAsked:
Who is Participating?
 
rrzConnect With a Mentor Commented:
You could use something like the following code. If you want it in a pop-up, then we could add javascript to do that.
<%@ page import="java.util.*,java.io.*" %>
<html>
<body>
Selected file is ${param.file}
<form>
<%
  File dir = new File(application.getRealPath("/xmlFiles"));
  String[] fileList = dir.list();
  for(int i =0 ; i<fileList.length ; i++){
      out.print("<input type='radio' name='file' value='" + fileList[i] + "'/>" + fileList[i]);
  }
%>
<input type="submit"/>
</form>
</body>
</html>

Open in new window

0
 
Ajay-SinghCommented:
You can follow this to upload the file http://www.devsphere.com/mapping/docs/guide/upload.html
0
 
emsenthilAuthor Commented:
Hi, Thanks for your reply.
But, I need the user to select the file which is in the server itself by providing a navigation box... I don want the user to upload the file.
0
All Courses

From novice to tech pro — start learning today.