• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 File Upload - Client's filepath

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone help me please...
We are using Struts2 file upload tag in my jsp for our users to upload a file.
In my action class, I could get the fileName that the user uploaded but is there a way I can get the entire filePath on client's machine?
If it is not possible, is there any other work around for me to do this.

 
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mathew. Getting the full file path on the clients machine is not possible. Browsers do not allow you to expose this kind of information to the webpages since it will be a huge security risk. By exposing the clients directory structure, a potential hacker may be able to retrieve any file from the filing system .
 
Mathew Geraldo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saif, thank you so much !!
 
Mathew Geraldo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saif, Thanks for your clarification.
We have a similar application (not in struts) that captured the entire client path.
So is the reason I was trying to check if we could do the same with struts2.
 
Saif Asif
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

We have a similar application (not in struts) that captured the entire client path.


Can I ask how were you achieving that ? By an ActiveX object ?
 
Mathew Geraldo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saif,
All I know is that the application was written in PERL CGI .
So maybe there is something in PERL/CGI that would allow access to clients file path.
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It used to be the case that Internet Explorer would upload the whole path, instead of just the file name. Other browsers don't do that, because of the security risks referred to in an earlier post. Perhaps recent versions of IE have fixed this problem -- I don't know because I haven't checked.

Perhaps your clients were all IE users?
 
Saif Asif
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saif,
All I know is that the application was written in PERL CGI .
So maybe there is something in PERL/CGI that would allow access to clients file path.


I see, I'll take a look at it just for knowledge purposes.

It used to be the case that Internet Explorer would upload the whole path, instead of just the file name. Other browsers don't do that, because of the security risks referred to in an earlier post. Perhaps recent versions of IE have fixed this problem -- I don't know because I haven't checked.

Perhaps your clients were all IE users?


Yes Paul , I can say about the older versions of IE ( prior to 7 ) , they used to send the complete physical address of the clients file system instead of just the file name although I am also not sure about the newer versions of IE. Maybe Mathew's was a very particular scenario where all clients were supposedly using an old IE version.
 
reply
    Bookmark Topic Watch Topic
  • New Topic