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

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.
  • Comment on Re^4: Printing a stream to STDOUT under mod_perl

Replies are listed 'Best First'.
Re^5: Printing a stream to STDOUT under mod_perl
by pmqs (Friar) on Mar 19, 2017 at 23:12 UTC

    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();
Re^5: Printing a stream to STDOUT under mod_perl
by beech (Parson) on Mar 17, 2017 at 01:31 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.

    Hi,

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

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