You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Zach Moazeni <za...@yahoo.com> on 2006/01/11 20:15:41 UTC
Accessing Files outside of WebApp
Hello,
In our current application I need to link to a file that resides
outside of the webapp directory. On another application we allowed the
users upload files and stored them in the webapp directory, which made
deployment a royal pain. This time we are storing the files in a
location external to Tomcat, however I need to let the users click a
link so they can download and open the file. I'd rather not "copy over"
the file to a tmp directory from which they download.
In Apache there was something like <Location>, is there something
like that in Tomcat?
Thanks for any input.
-Zach
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Accessing Files outside of WebApp
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
You may want to have a look at the ResourceServerServlet in Java Web Parts:
http://javawebparts.sourceforge.net/javadocs/javawebparts/servlet/ResourceServerServlet.html
That may give you what you want. It allows you to serve any resource from
a variety of sources (currently file system from any location, a URL or a
JAR file). It is also extensible if you would like to serve from another
location.
The main JWP page, if you should want to download:
http://javawebparts.sourceforge.net
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
On Wed, January 11, 2006 2:15 pm, Zach Moazeni said:
> Hello,
>
> In our current application I need to link to a file that resides
> outside of the webapp directory. On another application we allowed the
> users upload files and stored them in the webapp directory, which made
> deployment a royal pain. This time we are storing the files in a
> location external to Tomcat, however I need to let the users click a
> link so they can download and open the file. I'd rather not "copy over"
> the file to a tmp directory from which they download.
>
> In Apache there was something like <Location>, is there something
> like that in Tomcat?
>
> Thanks for any input.
> -Zach
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Accessing Files outside of WebApp
Posted by George Sexton <gs...@mhsoftware.com>.
What I do for my application is creat a URL mapping
/binaries/*
That maps to a servlet that then reads the files from the source directory,
and transmits them out the OutputStream.
George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
> -----Original Message-----
> From: Zach Moazeni [mailto:zacharooni@yahoo.com]
> Sent: Wednesday, January 11, 2006 12:16 PM
> To: Tomcat Users List
> Subject: Accessing Files outside of WebApp
>
> Hello,
>
> In our current application I need to link to a file that resides
> outside of the webapp directory. On another application we
> allowed the
> users upload files and stored them in the webapp directory,
> which made
> deployment a royal pain. This time we are storing the files in a
> location external to Tomcat, however I need to let the users click a
> link so they can download and open the file. I'd rather not
> "copy over"
> the file to a tmp directory from which they download.
>
> In Apache there was something like <Location>, is there something
> like that in Tomcat?
>
> Thanks for any input.
> -Zach
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Accessing Files outside of WebApp
Posted by Wade Chandler <hw...@yahoo.com>.
--- Zach Moazeni <za...@yahoo.com> wrote:
> Hello,
>
> In our current application I need to link to a
> file that resides
> outside of the webapp directory. On another
> application we allowed the
> users upload files and stored them in the webapp
> directory, which made
> deployment a royal pain. This time we are storing
> the files in a
> location external to Tomcat, however I need to let
> the users click a
> link so they can download and open the file. I'd
> rather not "copy over"
> the file to a tmp directory from which they
> download.
>
> In Apache there was something like <Location>,
> is there something
> like that in Tomcat?
>
> Thanks for any input.
> -Zach
>
I don't think there is, but I might be wrong. You
could do this using a servlet and mapping certain
"fake" directory paths to your servlet and then have
these paths configured to point to real directories
and then send back directory listings and files
depending on what the request is asking for. That
really shouldn't be that hard to do.
Wade
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org