This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Physical Path of a file 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 » Servlets
Bookmark "Physical Path of a file" Watch "Physical Path of a file" New topic
Author

Physical Path of a file

Anoosh Rahman
Greenhorn

Joined: Dec 07, 2000
Posts: 5
Please help me..
How can i get the physical path of a file from JSP/servlet
request.getPathInfo() and request.getPathTranslated() giving me null...
Thnaks in advance
eric clark
Greenhorn

Joined: Jan 18, 2001
Posts: 16
prolly ya could create a temp file and use it to determine your absolute path and delete it after?
String tempName = "foo";
File temp = new File(tempName);
temp.createNewFile();
String path = temp.getAbsolutePath();
String path = path.substring(0, path.indexof(tempName));
something this way should werk, grtx
eric
[This message has been edited by eric clark (edited February 14, 2001).]
Anoosh Rahman
Greenhorn

Joined: Dec 07, 2000
Posts: 5
Thank you.. eric clark for your fast response,
it does not give the actual physical path..
I have got the correct answer
using the getRealPath() of servletContext
it's working fine
Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Physical Path of a file
 
Similar Threads
Retrieving the path
Path of jsp files.
servlet request path confusion!
FilenotFoundException is thrown when tomcat is loaded
Depoly war file in tomcat