This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get file path in Struts file upload tag

 
aman thind
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to get the path of the file being uploaded. Thanks.
 
Ankit Garg
Sheriff
Posts: 9495
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of Struts are you using?? Is it Struts 1.x or Struts 2.x??
 
aman thind
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:Which version of Struts are you using?? Is it Struts 1.x or Struts 2.x??

I am using struts 2. Sorry,i should have mentioned it in the original question.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Path of which file? The local file? Or client file?

There's no way to get the path on the client in a reliable cross-browser way: what is sent depends on the browser. Some send only the filename (correct behavior), some send the entire path (security exposure).
 
aman thind
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Path of which file? The local file? Or client file?

There's no way to get the path on the client in a reliable cross-browser way: what is sent depends on the browser. Some send only the filename (correct behavior), some send the entire path (security exposure).


Oh.ok.I wanted the path of client file. I know how to get the file path of the local file. Thanks:)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic