This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hidden input type="file" technique

 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
I used hidden div, but your solution looks more appealing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic