Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java_server thread: Re: get the real path from the root directory


Message #1 by "Andy Shum" <shumandy@h...> on Mon, 2 Jul 2001 04:00:32
getRealPath() will do this. It's defined in the ServletContext class that
you can get by calling getServletContext(). An example to get the real path
of a file in the same folder as the servlet is

String realPath = getServletContext().getRealPath("myfile.txt");
File myfile = new File (realPath);

etc etc

chanoch

-----Original Message-----
From: Amit Sethi [mailto:amsethi@y...]
Sent: 30 June 2001 07:11
To: Java Server
Subject: [pro_java_server] get the real path from the root directory


Hi All,

Is there any method defined in java thru' which I can
get the real path from the root directory of my web
server running on Linux platform.I want to upload a
file thru' a browser.
If anybody have done this plz share it with me.

Regards

Amit Sethi

  Return to Index