Hello Noopur Kore ,
I had faced a similar scenario to yours a while back. First let me explain what happens to a file when you upload it to the server, it gets stored in a temporary folder where it is kept for access just at runtime only. The only issue is that it is a temp folder. When your file uploader
thread is done with the uploading , if you do not save the file of reference it from another thread, it will most probably get deleted or stored in some temp cache folder that you wont be able to locate at all ( atleast this is what happened with me but I was using
JBOSS server ). Now the temp folder of
tomcat is the work directory located at $CATALINA_HOME$/work and the complete location to the work directory specific to your project will be $CATALINA_HOME$/work/Catalina/localhost/<project_context_name>/ .
That said , lets come to the upload part , when you upload a file via form , it will be present in this work directory . Now when you upload it , it will appear in the work directory but it will be deleted after the upload thread gets done with it , so what you will do is that you will save it. Once saved, you can do whatever you like with it .