[Catalyst] Serve blob files into src="" type tags

A. Pagaltzis pagaltzis at gmx.de
Sat Mar 11 08:29:35 CET 2006


* apv <apv at sedition.com> [2006-03-11 07:55]:
>I've been searching around and reading a bunch of code but I
>can't find an "already complete" way to serve images (and other
>media like flash, aacs, mp4s and such) from a database.
>
>Is there something obvious I've missed?

Who knows? Your question isn’t very well posed. :-)

1. You shouldn’t put BLOBs in a database, particularly huge ones
   like MP4s; database engines are not designed for such jobs,
   filesystems are. Put the files somewhere you can get at them
   and serve them statically.

2. You can’t do this while generating the HTML, it requires
   another trip to the server. You want something alone the lines
   
       <img src="[% c.uri_for('get_blob', blobname) %]">

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list