[Catalyst] Using Content-Disposition Header
Danijel Milicevic
Danijel.Milicevic at rawmode.org
Tue Aug 30 20:54:49 CEST 2005
Am Dienstag, den 30.08.2005, 13:29 -0500 schrieb Thomas L. Shinnick:
> Others will no doubt know better, but this from my notes:
>
> Use the 'attachment' keyword on content-disposition to hint to the browser that this file should not be displayed but rather saved:
> Content-Disposition: attachment; filename="Culver_OL_2.LAS"
>
> Use the 'name' on the content-type as yet another way (in addition to the above) to suggest what the saved filename should default to:
> Content-Type: application/octet-stream; name="Culver_OL_2.LAS"
>
> Of course the actual mime type _should_ be accurate, like "application/pdf", but using "application/octet-stream" is supposed to help the browser decided to save as a file rather than try to display.
Exactly, in Catalyst code this is for example:
$c->res->headers->header( "Content-type" => 'text/csv');
$c->res->headers->header( "Content-Disposition" => 'attachment;
filename=export.csv');
Regards,
Danijel Milicevic
More information about the Catalyst
mailing list