tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Best place to store files ?
Date Wed, 08 Dec 2004 13:56:15 GMT

What Wendy said is right on, so I'm glad you're already down that path.

If the files are temporary, i.e. you don't mind them being erased when the server restarts,
you can use the javax.servlet.context.tempdir context attribute.  That's the portable, preferred
way to handle temporary files.  For permanent files, do what Wendy said.  

Tomcat is not deficient or lacking here in any way: if something is lacking, it's the Servlet
Spec, but I personally don't think it's lacking because there's still a use-case for the no-filesystem
servlet container.

Yoav Shapira

>-----Original Message-----
>From: Eric VERGNAUD []
>Sent: Tuesday, December 07, 2004 8:52 PM
>To: Tomcat Users List
>Subject: Re: Best place to store files ?
>le 8/12/04 0:15, Wendy Smoak à a écrit :
>> From: "Eric VERGNAUD" <>
>>> Yes it's simple. I was just wondering whether there was a preferred
>>> for this, and maybe a folder in the Tomcat directory for that purpose.
>> Nothing in the Servlet Specification requires Tomcat to provide you with
>> permanent place to put uploaded files.
>> My advice would be to put them outside of Tomcat, and write a thin layer
>> insulate the Servlet from whatever decisions you're making today.  That
>> if you decide at some point in the future to put the files in a database,
>> do something else with them, you don't have to mess with the Servlet
>> Your Servlet shouldn't know or care where the files are, it should just
>> 'read' or 'write' and let the data access layer deal with the details.
>Which is what I already do. As a matter of fact, the layer I'm using makes
>it look like a database.
>The only thing I was looking for is the preferred place for storing files.
>If there is none, that's ok.
>Eric VERGNAUD - JLynx Software
>Cutting-edge technologies and
>services for software companies
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message