You can set the header information to give mime hints to the browser:
$c-res-headers-content_type('application/octet-stream');
$c-res-headers-content_length( $stat-size );
$c-res-headers-last_modified( $stat-mtime );
$c-response-headers-header(
Hi,
I have a catalyst application which displays a list of files in a directory.
I would like to provide an anchor on the files to have them download according
to their
mime-type.
e.g. Clicking on a link to an excel file will stream the file with mime-type
application/excel just as though it
Hi Joe,
If you really want Catalyst to do this, check out
Catalyst::Plugin::Static::Simple and its configuration options.
It typically yields much better results to leave that action to your
webserver, though.
--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
[EMAIL PROTECTED] wrote on 02/16/2007 10:45:12 AM:
Hi,
I have a catalyst application which displays a list of files in a
directory.
I would like to provide an anchor on the files to have them
downloadaccording
to their
mime-type.
e.g. Clicking on a link to an excel file will stream
[EMAIL PROTECTED] wrote:
How do I do this through the Catalyst handler response mechanism?
Just like you'd serve any other data (see other posts in the thread
for the details). Get the data, set the headers, shove it into
$c-res-body. You might want to use some sort of sendfile
Thanks for the replies on this.
My reason for asking was that I didn't want to have a separate Apache config
section
for the directory containing the files.
Then the request goes though the catalyst url, it gets handled by the catalyst
hook and I
just want the webserver to do that for me.
By
On Fri, 16 Feb 2007 [EMAIL PROTECTED] wrote:
By the sounds of things I need to set up a separate apache config for
that part though.
It's not a big load of work though. We use fastcgi and our apache vhost
config looks like this:
Alias / /path/to/app/script/monday9am_fastcgi.pl/