This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 ??
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.