[Catalyst] Re: generating and redirecting to pdfs

Jason Galea lists at eightdegrees.com.au
Mon Oct 26 22:41:00 GMT 2009


On Sun, Oct 25, 2009 at 12:49 AM, Aristotle Pagaltzis <pagaltzis at gmx.de>wro=
te:

> * Jason Galea <lists at eightdegrees.com.au> [2009-10-21 01:50]:
> >   $c->res->header( 'Content-Disposition' =3D>
> 'attachment;filename=3D'.$c->stash->{pdf_filename} );
>
> This will break for filenames with spaces in them. For strict
> correctness, you want this:
>
>    ( my $pdf_filename =3D $c->stash->{ pdf_filename } ) =3D~ s!"!\\"!g;
>    $c->res->header( 'Content-Disposition' =3D> qq(attachment;
> filename=3D"$pdf_filename") );
>

hmm.. I'm missing something here.. won't that simply escape double quotes
and not affect spaces?


-- =

Jason Galea
Web Developer

Ph 07 40556926
Mob 04 12345 534
www.eightdegrees.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091027/9ad55=
37d/attachment.htm


More information about the Catalyst mailing list