Originally posted by bhagya raavi:
sir,
i written the code for uploding a file.after uploding it i read the content of file and written to a file.i want to save that file in the webserver folder where the tomcat is running.i uploaded the file in the remote place.
I've not used java/tomcat environment in months, but I think there are two things to try here:
- add the relative path of the file to the
http://webservername/ to make the file path (eg
http://localhost:8080/mywebsite/mysitesFiles/fileName.xyz) - or, make sure where you are saving the file is in the same folder, or subfolder, where you are running your web application from. I don't think tomcat - or probably any decent container for that matter - will allow you to save in the container's context if it is outside of the currently running web application's folder. For instance, you probably can't save in c:\tomcat\someFolder if you are running your site out of c:\tomcat\mywebsite