Is it possible to create a browse window(say using a button which is labeled 'Browse') from a jsp which will look into the local file system and gets the name of the file and the contents into 2 different variables?
You can't browser thru the files on the client's machine. You can do whatever you want on the Server's FileSystem. If this browse menu is for the purpose of uploading a file, just use the HTML file tag. Example:
Thanks a lot for your response. But I am not sure I understood this right cos' I have this code in my jsp:
-----------------------------------------------------------------------------------------
<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
<TITLE>
Browse file system
</TITLE>
</HEAD>
<BODY>
<P>
<FORM ACTION="upload.jsp"
ENCTYPE="multipart/form-data" METHOD=POST>
<INPUT TYPE=FILE NAME=file>
<INPUT TYPE=SUBMIT>
</FORM>
</P>
</BODY>
</HTML>
--------------------------------------------------------------------------------------------------
This opens a jsp with a text field and a browse button, submit query button. This browsed my local file system. All the C drive, D drive everything.
I have an Oracle OC4J server running on my machine. I deployed it here and tried accessing the jsp from a differnt machine. The browse button was able to access that machine's local file system.
So, how does this work? I am wrong in understanding the concept?
Please clarify. Thanks a lot again for your time.
Savy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.