You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Pedersen <jo...@gmail.com> on 2007/02/16 11:55:36 UTC

where to store user-generated files?

Hi,

I have an app that generates some big, expensive-to-create files.

Where can I store these files, so that they aren't destroyed when I
reload or redeploy, and still get allow users to access them via
Tomcat?

Thanks,

John Pedersen

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: where to store user-generated files?

Posted by Peter Crowther <Pe...@melandra.com>.
> From: John Pedersen [mailto:john.pedersen@gmail.com] 
> Maybe I am asking too much ( I chose a long time ago not to store
> images and large files in the db - just store names and urls - maybe
> this was a poor choice.)

A lot depends on your environment.  For small projects I tend to store
in database - being able to get a consistent snapshot of database and
filestore is important in some of the applications I work in.  Sakai
(www.sakaiproject.org) can be configured to do either - small sites
often store in the database, the large sites (100,000+ users) tend to
store on filestore due to size restrictions on their RDMBSs.  Bodington
(www.bodington.org) stores in filestore outside the servlet's URL space,
and has code to parse the request URL, check security, read the file
from filestore and deliver it if desired.  Unless you *know* you can
control security in other ways, I'd suggest going down the Bodington
route if you want to use filestore.

Sakai and Bodington are both in Java under suitably free licenses
(Sakai's ESL, Bod is Apache2), so you could probably lift code from
either if it fit your requirements.  I've no doubt there are other
projects out there that have the same requirements (and probably cleaner
code); these are merely two I know.

		- Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: where to store user-generated files?

Posted by John Pedersen <jo...@gmail.com>.
Thanks for the reply. Can you provide any more details as to how to go
about this. I have googled quite a bit - I would have thought that
this is quite a common requirement, but I don't see references to it.

I should mention that some of the files are images that the users
upload, and need to be accessible through the app via relative urls.

Maybe I am asking too much ( I chose a long time ago not to store
images and large files in the db - just store names and urls - maybe
this was a poor choice.)

On 16/02/07, Mikolaj Rydzewski <mi...@ceti.pl> wrote:
> John Pedersen wrote:
> > I have an app that generates some big, expensive-to-create files.
> >
> > Where can I store these files, so that they aren't destroyed when I
> > reload or redeploy, and still get allow users to access them via
> > Tomcat?
> Store them outside of Tomcat directory tree and access them either by a
> proxy servlet or create separate context pointing to that 'external'
> directory.
>
> --
> Mikolaj Rydzewski <mi...@ceti.pl>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: where to store user-generated files?

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
John Pedersen wrote:
> I have an app that generates some big, expensive-to-create files.
>
> Where can I store these files, so that they aren't destroyed when I
> reload or redeploy, and still get allow users to access them via
> Tomcat?
Store them outside of Tomcat directory tree and access them either by a 
proxy servlet or create separate context pointing to that 'external' 
directory.

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org