aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Hidden input type= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Hidden input type="file" technique" Watch "Hidden input type="file" technique" New topic
Author

Hidden input type="file" technique

dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
I noticed that many apps use hidden file upload field, so curiouis about implementation technique
1. Is input type=file placed in div with no visibility?
2. Is an event onclick sent to open file choose dialog?
3. Is onchange handler used for submission a form when user selected a file?
Can somebody provide a JS code example?
Another question related how to upload links. In classic input type=file I can type path or even URL/link (noticed that IE doesn't allow URL for security reason, however FF does). How to manage that in both browsers friendle manner, when a user can directly provide a link?


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
Are you quite sure about this? I've never seen (or read about) hidden file upload fields, and Google seems to know nothing about them. Could you provide an example?


Ping & DNS - my free Android networking tools app
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
Actually I'm looking for an example to save some time on implementation. Such fields used in Microsoft's live mail or gmail. Since both products prohibit reverse engineering, I can't pull an implementation from them. Of course I'll share my implementation with all of you without problems.
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
If you looking for IE only solution, then you can do something similar to


also, take alook at http://www.quirksmode.org/dom/inputfile.html
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
Thanks,
I used hidden div, but your solution looks more appealing.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hidden input type="file" technique