You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Michael <mi...@savicom.net> on 2006/02/16 01:24:16 UTC

Tturning off buffering for txt file downloads

I'm trying to download a very large text file, and I'd like to turn off 
buffering on a per-page basis, since most of our
pages don't take too long to generate.

After looking through the docs, I've tried setting various combinations 
of flags in config:
  optEarlyHttpHeader, optSendHttpHeader, dbgFlushOutput

But it's not clear to me that this works on per page basis for embperl 
2, or if it does, how to output my "special" headers,
rather than the standard headers:
  $http_headers_out{'Content-Type'} = 'text/list';
  $http_headers_out{'Content-Disposition'} = 'attachment; 
filename="recipientEmails.txt"';

The only (bad) solution I've found for this is to completely bypass the 
embperl output. I write my headers to standard out, followed
by my text data. I don't have embperl write anything. Then I call the 
embperl exit function to prevent embperl from sending its own
headers.

Any suggestions ?

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Tturning off buffering for txt file downloads

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> 
> I'm trying to download a very large text file, and I'd like 
> to turn off buffering on a per-page basis, since most of our 
> pages don't take too long to generate.
> 
> After looking through the docs, I've tried setting various 
> combinations of flags in config:
>   optEarlyHttpHeader, optSendHttpHeader, dbgFlushOutput
> 

These options are no longer supported in Embperl 2 (see README.v2).

Unfortuinately Embperl 2 cannot turn off buffering and delivers the page all
at once

> But it's not clear to me that this works on per page basis 
> for embperl 2, or if it does, how to output my "special" 
> headers, rather than the standard headers:
>   $http_headers_out{'Content-Type'} = 'text/list';
>   $http_headers_out{'Content-Disposition'} = 'attachment; 
> filename="recipientEmails.txt"';
> 

Setting header in that way should work, but you should not set one of the
options optEarlyHttpHeader, optSendHttpHeader.

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org