*
The moose likes Struts and the fly likes How to get file path in Struts file upload tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to get file path in Struts file upload tag" Watch "How to get file path in Struts file upload tag" New topic
Author

How to get file path in Struts file upload tag

aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
Is there a way to get the path of the file being uploaded. Thanks.


Aman Thind
SCJP,SCWCD
JAVA utte mar JAVA,mit JAVA
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Which version of Struts are you using?? Is it Struts 1.x or Struts 2.x??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jun 29, 2007
Posts: 71
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:)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get file path in Struts file upload tag
 
Similar Threads
filereader
About file path
Cannot find file location
absolute path Formfile upload
Getting absolute path of image file