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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call the 'browser' 1

Status
Not open for further replies.

ibike

Programmer
Apr 7, 2003
27
IT
Does somebody knows how can I call the file browser from Java?
 
The file browser opens when you click on a file input (input type=file)
If you have an image that you want to open the file browser when you click on it you can hide the file browser and trigger the click event for the file browser.
I tested this with IE 6, in mozilla 5.0 it chrashed because of the style of the text input:

<label id=&quot;lblFile&quot;>File name comes here</label><br>
<input type=file id=fleMyFile style=&quot;position: absolute;top: -1000;left;-1000&quot; onchange=&quot;document.getElementById('lblFile').innerHTML=this.value;&quot;>
<input value=&quot;Click here to open file browser&quot; title=&quot;Click here to open file browser&quot; style=&quot;cursor:hand&quot; type=button onclick=&quot;document.getElementById('fleMyFile').click();&quot;>
 
Harmmeijer, thank you very mutch for your help it works perfectly. One additional thing what I'd like to know yet is it possible makes a filter for file type what the user could open from this bowser?
 
I tried and gave up on it.
Don't think it is possible (in IE) unless you use an active x control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top