[Catalyst] File downloads - Plugin?

Christopher H. Laco claco at chrislaco.com
Tue Aug 16 14:44:22 CEST 2005


samwyse wrote:
> On 8/11/05, Toby Corkindale <tjc at wintrmute.net> wrote:
> 
>>Hi,
>>I'm in a position where I'd like to serve file downloads, out of database
>>BLOBs, via Catalyst.
>>
>>These files are potentially very large, and so I would rather not suck the
>>entire lot of data out of the DB and into Catalyst's $c->response->output()
>>variable.
> 
> 
> If you want to serve things via Catalyst, I'd expect the data to pass
> through Catalyst.  If you want to get Catalyst out of the way, then
> I'd look towards alternate methods of serving.  In other words, handle
> it in much the same way that static data is handled, because that's
> what it is:  static data that just happens to be kept in a database
> instead of a filesystem.
> 

I've been thinking about this lately. Shouldn't it be possible to have 
Catalysts MP engine add the urls it handle to apache config at runtime?

Then, anything Catalyst handles is forwarded to set-handler to itself, 
and everything else Just Works as real Apache requests?

This suedo code of course...I've not yet put Catalyst under MP...but you 
get the idea....


MyApp::C::Foo;

sub doit : Global {

};


Then, when Catalyst loads into MP, it does:

<Location /doit>
	set-handler perl-scripts
	Catalyst::Engine
</Location>

 From there on out, all request to things like /css/style.cc, etc Just 
Work, while Catalyst still does it's thing on methods it knows... like /doit


-=Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20050816/dbbe8a1e/smime.bin


More information about the Catalyst mailing list