tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Crowther <peter.crowt...@melandra.com>
Subject Re: Reading and writing files outside tomcat directory
Date Tue, 03 Nov 2009 11:10:04 GMT
Tomcat version?
Installed from tomcat.apache.org or a third-party repackaged version?
If repackaged, look at the docs - are you running under a security manager?

- Peter

2009/11/3 noobie45 <philip.george@gmail.com>

>
> I have an application whose class files are in
> /usr/local/tomcat/webapps/ROOT/WEB-INF/classes
>
> It uses the following line to write a file called java.php:
> FileOutputStream fout  = new FileOutputStream
> ("/usr/local/tomcat/webapps/ROOT/java.php", true);
>
> It does this perfectly.
>
> What I want is to write this file to a directory outside the tomcat
> directory. e.g. to /var/www/newdir
>
> In Tomcat under Windows I have no problem doing this. Tomcat is installed
> in
> F: and I can write to my apache directory c:\Apache2\htdocs by putting this
> file path in the above code line.
>
> But Tomcat under Linux does not allow me to do this, apparently for
> security
> reasons. But security does not really matter for me because this
> application
> won't be open. How do I read and write files outside the home directory?
> --
> View this message in context:
> http://old.nabble.com/Reading-and-writing-files-outside-tomcat-directory-tp26160054p26160054.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message