How do I upload a file from a Java servlet to a location on a web server within Tomcat/webapps.
I am using Commons upload. I have a location such as myserver:8080/myapp/mylocation
where I want to put the files that are uploaded.
I tried using getServletContext().getRealPath("/");
to find where I am and then appended that with mylocation but I get a nullpointer exception.
I know I sound vague, it's because I am confused about the big picture, what are the generals steps I need to perform to make this work. Any code or links to code would be much appreciated.