• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Issue with [html:file] tag

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI..,
Am using struts ... to build a content management system
I am Using <html:file></html:file> tag to get the file from the local system
Everything 's working fine in the Action
How ever on reload the page is displayed without any File name which was selected earlier....
On viewing soutce of the page
I found the "file name" in the <html:file value="c:/desktop/abc.xsl"></html:file>
My question is
1) If i am setting the value in the struts property file
Why its not displaying...?
2) In case there is any other way to resolve the issue...Explain


Thanks in advance

Tuhin

[ September 23, 2007: Message edited by: Tuhin Ghosh ]
[ September 23, 2007: Message edited by: Tuhin Ghosh ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even though the <input type="file" > HTML element accepts a value attribute, neither Internet Explorer nor FireFox will display any value set on the server-side in this control. In short: There's no way have a value placed in this control when the page is refreshed.

It's a security issue. If it were allowed, what would prevent a malicious website from populating this field with the name of your Outlook file with all your contacts and then having JavaScript submit the page before you even knew what was happening?

About the only way I know to work around this would be to use an Applet for your upload. If you look around, I suspect you will find some already written for this purpose.
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic