I use this http://code.google.com/p/gwtupload/ to upload files to my app. But I have problem when I want save file out of my app in other folder in Tomcat. (for example my app's name is MyApp but I want save files in folder Data on the same Tomcat server). Can someone know why I can't do that ?
Asked
Active
Viewed 324 times
0
-
Write the file in `/some/location/where/yourTomcatUser/hasPermissions/`. As a test, make sure the folder has read/write permissions for all your users and groups (this would be a `chmod -777` in unix/linux based OS) – Luiggi Mendoza Feb 09 '13 at 07:22
-
I need know how get the path of tomcat. Not to app. Now i get it by "getServletContext().getRealPath("/")" but this is path to my app. I want get folder up path – Zaki Feb 09 '13 at 10:35
-
1I didn't say you to use the path of your app. Also, it will be pretty bad if you save the uploaded files inside the Tomcat (or another web application server) folders, instead you should use another path that don't mix with them. Read [Best Location for Uploading file](http://stackoverflow.com/q/4548190/1065197) – Luiggi Mendoza Feb 09 '13 at 13:59
1 Answers
0
Is it what you are looking for ??
Tomcat home directory or Catalina directory is stored at the Java System Property environment. If the Java web application is deployed into Tomcat web server, we can get the Tomcat directory with the following command
System.getProperty("catalina.base");

Suresh Atta
- 120,458
- 37
- 198
- 307
-
Please check the link in my last comment on OP's question. Your suggestion is limited to Tomcat only, what if the application is redeployed on JBoss, GlassFish, WebSphere or another web application server? – Luiggi Mendoza Feb 09 '13 at 14:00