| Author |
Getting realpath in webspehere
|
Chetan Sharma
Greenhorn
Joined: Nov 20, 2008
Posts: 7
|
|
when I am uploading a file using filepath getServlet().getServletContext().getRealPath("/"). Using this I am getting filepath as F:\PAF\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\paf_v1EAR.ear\paf_v1.war 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
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
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.
|
 |
 |
|
|
subject: Getting realpath in webspehere
|
|
|