The moose likes Websphere and the fly likes Getting realpath in webspehere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Getting realpath in webspehere" Watch "Getting realpath in webspehere" New topic

Getting realpath in webspehere

Chetan Sharma

Joined: Nov 20, 2008
Posts: 7
when I am uploading a file using filepath getServlet().getServletContext().getRealPath("/"). Using this I am getting filepath as

where F:\PAF is my workspace. This is a temporary folder which gets deleted after sometime. Can you tell me how can I upload files in a folder say upload inside PAF workspace i.e. F:\PAF\upload ??
Paul Clapham

Joined: Oct 14, 2005
Posts: 19853

If you don't like the directory which those methods give you, who is forcing you to use it? Go ahead and upload to F:\PAF\upload if you like.

Also, you're running this inside Eclipse. I assume this is a web application which is going to be deployed on an actual web application server at some point. You're going to have the same problem there: every time you redeploy your application, anything you uploaded to a folder in the application will disappear. So you should consider uploading to some other directory outside the web application anyway.
Don't get me started about those stupid light bulbs.
subject: Getting realpath in webspehere
It's not a secret anymore!