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

I have. But this won't work for my needs.
  • Comment on Re^2: Printing a stream to STDOUT under mod_perl

Replies are listed 'Best First'.
Re^3: Printing a stream to STDOUT under mod_perl
by beech (Parson) on Mar 16, 2017 at 02:33 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?