Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

browse window from jsp

Status
Not open for further replies.

savy

Programmer
Nov 26, 2002
2
US
Hi,

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?

Thanks a lot in advance.
savy
 
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:
Code:
<input type=&quot;file&quot; name=&quot;fileUpload&quot;>
Wushutwist
 
Hi Wushutwist,

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=&quot;text/html;charset=WINDOWS-1252&quot;%>
<HTML>
<HEAD>
<META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html; charset=WINDOWS-1252&quot;>
<TITLE>
Browse file system
</TITLE>
</HEAD>
<BODY>
<P>
<FORM ACTION=&quot;upload.jsp&quot;
ENCTYPE=&quot;multipart/form-data&quot; 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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top