Hi,

I use Archive::Zip to generate zip files on the fly in Modperl 2.04 with
code similar like this:

my $zip = Archive::Zip->new();  
my $member = $zip->addFile( '/home/testimg/test1.jpg', 'testfile1.jpg' );
if ($member){
  $member->desiredCompressionLevel( 1 );
}
$member = $zip->addFile( '/home/testimg/test2.ppt', 'testfile2.ppt' );
if ($member){
  $member->desiredCompressionLevel( 1 );
}
        
if ( $zip->numberOfMembers() ){
  unless ( $zip->writeToFileHandle( \*STDOUT, 0) == Archive::Zip::AZ_OK) {
    print STDERR "Zip error: $!";
  }
}

This works fine with Archive::Zip version 1.26 but fails with version 1.30
I checked the ARchibe::Zip code and could not find anything that can cause
the problem accept for the change from using Compress::Zlib to
Compress::Raw::Zlib.

The error is: 'IO error: seeking to rewrite local header : Invalid argument'

If I use desiredCompressionLevel(0) then there is no problem but no
compression is done.

The error is only related to Mod_perl.  As a console script it runs fine.
Problem is on both Windows and Linux (perl 5.10).

Has anyone any idea what might be the problem? or have an alternative
solution?

Thanks,

Thomas den Braber 


Reply via email to