<%doc> Used for displaying binary content. For example, to display an image you can: 1) Invoke this page directly with an id to display, or; 2) Embed a reference to this page in another page, for example: This currently assumes "filetype" in the database represents the objects mime type. <%args> $table $id <%init> my $binfile = $table->retrieve($id); $m->comp("/generic/error.mhtml", error=>"$table id $id could not be retrieved") unless ( $binfile ); $m->comp("/generic/error.mhtml", error=>"$table id $id has no filetype") unless ( $binfile->filetype ); $m->comp("/generic/error.mhtml", error=>"$table id $id has no data") unless ( $binfile->bindata ); $m->clear_buffer; # Do not print headers $r->content_type($binfile->filetype); $m->print($binfile->bindata); $m->abort("OK"); # Do not print footers