You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Will Hartung <wi...@msoft.com> on 2005/01/07 00:41:05 UTC

Serving files from Tomcat...sorta

Simply put, we have a system where folks are able to upload files into an
'incoming' directory, and download any of their files from any place below
their home directory.

We want to expose this through the web using HTTPS.

Couple of things I'd like to do here.

a) Authenticate the users against the generic /etc/passwd unix scheme
(/etc/shadow in our case).

b) I'd like to, if practical, have Tomcat serve the files or, at least, have
access to the mime-mappings in the conf/web.xml

c) do as little work as possible :-)

In the most basic form, this is a reasonably simple project, scan a
directory, dump out an "ls -l" of it, let them click on and then serve the
files.

But Tomcat already has code to serve static files, so I was hoping to
leverage that ability.

I figured I'd make each "home" directory a "role", and then use a Realm to
manage the security bits, either hunting down a Unix Realm or writing my
own, that shouldn't be too hard.

In fact, I'm betting a bunch of this is in Tomcat somewhere (directory
browsing et al), so I was kind of hoping someone might have some hints on
stuff I can leverage to pull this seemingly simply thing off.

Any hints?

Thanx!

Regards,

Will Hartung
(willh@msoft.com)


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Serving files from Tomcat...sorta

Posted by Will Hartung <wi...@msoft.com>.
> From: "Mark Thomas" <ma...@apache.org>
> Sent: Thursday, January 06, 2005 3:57 PM

> Have you looked at using webDAV? Tomcat has a basic implementation or
> there is the slide project.

Yes, I thought of that immediately too, but too complicated to potentially
configure over the phone with a random end user.

Regards,

Will Hartung
(willh@msoft.com)


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Serving files from Tomcat...sorta

Posted by Mark Thomas <ma...@apache.org>.
Have you looked at using webDAV? Tomcat has a basic implementation or 
there is the slide project.

Mark

Will Hartung wrote:
> Simply put, we have a system where folks are able to upload files into an
> 'incoming' directory, and download any of their files from any place below
> their home directory.
> 
> We want to expose this through the web using HTTPS.
> 
> Couple of things I'd like to do here.
> 
> a) Authenticate the users against the generic /etc/passwd unix scheme
> (/etc/shadow in our case).
> 
> b) I'd like to, if practical, have Tomcat serve the files or, at least, have
> access to the mime-mappings in the conf/web.xml
> 
> c) do as little work as possible :-)
> 
> In the most basic form, this is a reasonably simple project, scan a
> directory, dump out an "ls -l" of it, let them click on and then serve the
> files.
> 
> But Tomcat already has code to serve static files, so I was hoping to
> leverage that ability.
> 
> I figured I'd make each "home" directory a "role", and then use a Realm to
> manage the security bits, either hunting down a Unix Realm or writing my
> own, that shouldn't be too hard.
> 
> In fact, I'm betting a bunch of this is in Tomcat somewhere (directory
> browsing et al), so I was kind of hoping someone might have some hints on
> stuff I can leverage to pull this seemingly simply thing off.
> 
> Any hints?
> 
> Thanx!
> 
> Regards,
> 
> Will Hartung
> (willh@msoft.com)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Serving files from Tomcat...sorta

Posted by Parsons Technical Services <pa...@earthlink.net>.
1. Set listings to true in the default web.xml.

2. Place a welcome file in any directory that you do not want to display 
listings.

3. Set up a realm per this link:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/realm-howto.html

4. Deploy an upload app for each user. Define the matching role in the 
web.xml for the app and name the app the user name.

The user can upload to the directory ../user/list/
This directory will contain only the files the user uploads and as long as 
the user does not upload a file with a name to match the welcome file name 
you will always get the listing when you browse to 
www.yadayada.com/user/list/

You can create a schema that allows some users access to groups of app by 
the roles such as admin that allows you to access all the files.

Doug


----- Original Message ----- 
From: "Will Hartung" <wi...@msoft.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, January 06, 2005 6:41 PM
Subject: Serving files from Tomcat...sorta


> Simply put, we have a system where folks are able to upload files into an
> 'incoming' directory, and download any of their files from any place below
> their home directory.
>
> We want to expose this through the web using HTTPS.
>
> Couple of things I'd like to do here.
>
> a) Authenticate the users against the generic /etc/passwd unix scheme
> (/etc/shadow in our case).
>
> b) I'd like to, if practical, have Tomcat serve the files or, at least, 
> have
> access to the mime-mappings in the conf/web.xml
>
> c) do as little work as possible :-)
>
> In the most basic form, this is a reasonably simple project, scan a
> directory, dump out an "ls -l" of it, let them click on and then serve the
> files.
>
> But Tomcat already has code to serve static files, so I was hoping to
> leverage that ability.
>
> I figured I'd make each "home" directory a "role", and then use a Realm to
> manage the security bits, either hunting down a Unix Realm or writing my
> own, that shouldn't be too hard.
>
> In fact, I'm betting a bunch of this is in Tomcat somewhere (directory
> browsing et al), so I was kind of hoping someone might have some hints on
> stuff I can leverage to pull this seemingly simply thing off.
>
> Any hints?
>
> Thanx!
>
> Regards,
>
> Will Hartung
> (willh@msoft.com)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org