tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Question about File ownership file upload and HTTP Post
Date Fri, 27 Jul 2007 18:41:50 GMT
Hash: SHA1


Josh Rountree wrote:
> I have a servlet that processes requests for file uploads. When I
> write this file to disk, root is the owner?

You should not be running Tomcat as root. Are you doing that? Stop it!

> Is this the correct behavior?

Unless you do something special, the file will be owned by the user that
the Tomcat process is running as.

> Since I do not have root access on the machine that the servlet
> executes I cannot remove these files. Any documentation that explains
> how to change the owner of these uploaded files?

File ownership is one of those things that Java does not handle very
well. There's a bug report that's still in progress at Sun:

All the related documentation for this bug (and duplicates of it) says
to write your own native wrapper around the filesystem calls necessary.
Fortunately, such a wrapper would be very simple to write, if still a
pain in the neck to deploy, etc.

- -chris

Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message