You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jaak <va...@hot.ee> on 2002/02/19 20:14:50 UTC
Content-Disposition and $http_headers_out
Hi!
I have used
print "Content-type: application/octet-stream\n";
print "Content-Disposition: attachment; filename=demo.tmp\n";
print "Content-Description: sample\n\n";
to dump some files from mySQL databases.
Now I wish to import it to embperl mode.
I used $http_headers_out{Content-type} = "application/octet-stream";
$http_headers_out{Content-Disposition} = "attachment; filename=demo.tmp";
But it won't work. What is wrong?
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Content-Disposition and $http_headers_out
Posted by Gerald Richter <ri...@ecos.de>.
>
> Now I wish to import it to embperl mode.
> I used $http_headers_out{Content-type} = "application/octet-stream";
> $http_headers_out{Content-Disposition} = "attachment; filename=demo.tmp";
>
Because the header names contains a minus you need to quote them, otherwise
Perl will treat it a a expression e.g.:
$http_headers_out{'Content-Disposition'} = "attachment; filename=demo.tmp";
Addtionaly you should turn off Embperl HTML escaping by saying
$escmode = 0 ;
somewhere at the start of the page
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org