[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Restricting files



on 3/1/00 11:35 AM, HeIlMaster@xxxxxxx at HeIlMaster@xxxxxxx wrote:

> In a message dated 3/1/00 1:24:34 PM Central Standard Time,
> kris@xxxxxxxxxxxxx writes:
> 
> << Sure, add an apache AddType for those file types to send it thru a wrapper
> or something >>
> 
> Ok, do you know where i could get a wrapper from to do this, or could i
> program one in perl to do it? Where could i get some info on how to make a
> wrapper?

Basically, in your httpd.conf or srm.conf:

ScriptAlias /filewrapperDir/ /usr/filewrapper/
Action filewrapper /filewrapperDir/filewrap.pl

AddHandler filewrapper .mp3
AddHandler filewrapper .whatever

You should get some information passed to your executable--wheather it is
written in perl and called filewrap.pl is up to you.  I don't know what
additional info is passed, but you can probably figure it out try-and-error
style.  I bet that if you just write a script like this:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Sorry, you're not allowed to download this file";

and called it filewrap.pl , chmod it to 755 and put it in /usr/filewrapper
it'll work.

This is all just with a tiny bit of research, and a couple of assumptions,
but I think it should work.  It'll require some trial and error for sure.

-k