tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Cheshire <>
Subject Re: best practice for temporary file
Date Tue, 17 Jul 2018 14:36:02 GMT
James, this can be done using something like the following
configuration in your META-INF/context.xml (I use tomcat 8.5)

  <PreResources className="org.apache.catalina.webresources.DirResourceSet"
                webAppMount="/images" />

I use this to serve files at /images because they are dynamic content
and not part of the war itself. Make sure the directory specified by
"base" has read and write permission by the tomcat user at the OS
level and then you can serve files with a uri starting with /images/.



On Tue, Jul 17, 2018 at 10:21 AM James Finnall <> wrote:
> Hello all,
> What is the best practice under Tomcat to create a data file and then
> allow the client to download it?
> So far all my attempts have failed.  If the Java app can write it then
> the client can not download, if client can download then the Java app
> can not write it.
> Does Tomcat have a provision to create a directory that be shared by
> both the app and the client?
> Thank you for your consideration,
> James
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message