| Buscador documentation | Contained in the Buscador distribution. |
Buscador::Attachment - Buscador plugin to access attachments
This plugin allows you to do
${base}/attachment/view/<id>
And either download or view an attachment. It sets the filename correctly using Content-Disposition.
Simon Cozens, <simon@cpan.org>
with work from
Simon Wistow, <simon@thegestalt.org>
Copyright 2004, Simon Cozens
| Buscador documentation | Contained in the Buscador distribution. |
package Buscador::Attachment; use strict;
package Email::Store::Attachment; use strict; use MIME::Base64 qw(decode_base64); sub view :Exported { my ($self, $r, $att) = @_; $r->ar->headers_out->set("Content-Disposition" => "inline; filename=".$att->filename) if $att->filename; $r->{content_type} = $att->content_type; $r->{output} = ($att->content_type =~ m!^text/!) ? $att->payload: decode_base64($att->payload); } 1;