in reply to Re^2: Printing a stream to STDOUT under mod_perl
in thread Printing a stream to STDOUT under mod_perl

Hi,

What do you mean?

Have you seen https://perl.apache.org/docs/1.0/guide/porting.html#Apache__print___and_CORE__print__?

  • Comment on Re^3: Printing a stream to STDOUT under mod_perl

Replies are listed 'Best First'.
Re^4: Printing a stream to STDOUT under mod_perl
by Rodster001 (Pilgrim) on Mar 16, 2017 at 18:09 UTC
    That probably works with Apache::PerlRun but it is broken with Apache::Registry. I don't know where the disconnect is. Archive::Zip::SimpleZip streaming to STDOUT gets lost.

      Just tried the simple simple version of your script (shown below) using both ModPerl::Registry and ModPerl::PerlRun. Both worked as expected. I could download myarchive.zip from my apache server without any trouble.

      Perhaps you could share more details on what isn't working?

      use Archive::Zip::SimpleZip ; print "Content-Disposition: attachment; filename=\"myarchive.zip\"\r\n +"; my $z = new Archive::Zip::SimpleZip '-', Stream => 1; my $fh = $z->openMember(Name => "myarchive.zip"); print $fh "hello world\n"; close($fh); $z->close();

      That probably works with Apache::PerlRun but it is broken with Apache::Registry. I don't know where the disconnect is. Archive::Zip::SimpleZip streaming to STDOUT gets lost.

      Hi,

      What if you use  my $z = Archive::Zip::SimpleZip->new(*STDOUT, Stream => 1 ); ?

      Does print "\nhello\n" ; get printed to the client?