File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Get file path in mozilla ff Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Get file path in mozilla ff" Watch "Get file path in mozilla ff" New topic
Author

Get file path in mozilla ff

sadanand munswamy
Ranch Hand

Joined: Apr 10, 2012
Posts: 39
Hi All,
I am using an input type = file in my application and the issue is with the file path.
The path is visible in i.e, but mozilla ff just renders the file name, How do i get the complete
file path in mozilla. HELP !!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

IE is broken in that it reveals the path. No other browser has this security flaw. Why do you need the path in the first place? You will not be able to get it any other browser but IE.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

And you won't be able to do anything with the path information anyway. Except maybe you could store it somewhere, but what would be the point of that?
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Just clarifying what these guys have already said.

The file path is irrelevant.
If you are expecting to read the file via new File(pathToFile), think again. That file is on the client's machine. So it will initally work on your computer (if you are developing with your computer being both client and server) but once you deploy it you will get FileNotFoundExceptions.

The file input component sends the file with the request. You have to read the file from the request.
Check out a file upload library like the one found at apache commons.
 
wood burning stoves
 
subject: Get file path in mozilla ff
 
Similar Threads
Mozilla and this.style.cursor='hand'
FireFox, taking back the web?
Loading a javascript file with file://
Dynamic Element Function Parameter
Browsers and jre plugins for applets