I am working around in a problem where i need to create an upload folder in to tomcat base directory so that can place my upload files there don’t want to do this inside the webapps folder.
later on i want to access this folder in my web-application to get that files being uploaded.
though i got success using the below code
File dir = new File(System.getProperty("catalina.base"), "uploads");
but its giving me path like
G:\Program Files\Tomcat 6.0\uploads
from which i can access the files but i want the path something like this
http//localhost:// path to my upload folders
i tried various way to achieve this but nothing has worked.
i was playing around this but it did’t worked out
ServletActionContext.getServletContext().getRealPath()
can any one give me an idea how i can do this?
Thanks in advance
Add the following to
/conf/server.xmlof Tomcat:It’ll be available by http://localhost/uploads