You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Martin Stingl <ma...@dfv.de> on 2000/04/02 19:15:22 UTC

Sending binary files within Embperl

Hello,

I use pdflib for generating a pdf-File inside a embperl-page.
After the file is created I want to send it to the browser.
Setting the content-type with $http_headers_out{'Content-Type'}
works fine.

But Embperl breaks the binary content of the pdf-file.
$escmode = 0;
isn't enough I guess.
$optRedirectStdout = 16384; 
doesn't work. 
Embperl just stops  sending the content after reaching some zero bytes.


Is there any way to send a binary file 'asis' using Embperl?

TIA,
Martin


RE: Sending binary files within Embperl

Posted by Gerald Richter <ri...@ecos.de>.
Hello,
>
> I use pdflib for generating a pdf-File inside a embperl-page.
> After the file is created I want to send it to the browser.
> Setting the content-type with $http_headers_out{'Content-Type'}
> works fine.
>
> But Embperl breaks the binary content of the pdf-file.
> $escmode = 0;
> isn't enough I guess.
> $optRedirectStdout = 16384;
> doesn't work.
> Embperl just stops  sending the content after reaching some zero bytes.
>
>
> Is there any way to send a binary file 'asis' using Embperl?
>

This issue has came up serveral times in the last month. The current version
of Embperl isn't binary clean. As you already recognized, it stops at a
binary zero (because that's the end of a string in C). When I design
Embperl, I had only text files in mind.

It's already on the todo list and Embperl 2.0 will surely be binary clean. I
hope, but cannot promise, I get out a first beta of 2.0 during april

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 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------