Solved !

Ladies and Gentlemen, you REALLY made my day !
Thanks to all contributors !
Here is the working codesniplet:

sub download { use CGI; $html=new CGI; #print $html->header(-type => 'application/octet-stream', -attachment +=> $_[1]); print $html->header(-type => 'application/zip', -attachment => $_[1]); + open($peunter, "<", $_[0].$_[1]); binmode($peunter); binmode STDOUT; while (read($peunter,$bytes,1024)) { unless (eof()) { chomp($bytes); } print $bytes; } #@data = <$peunter>; close($peunter); #print "@data"; }
Sorting out the file structure exported in the zipfle downloaded, should be a matter of try and error...
Again: thanks a lot for all your hints !

Hello everybody ! First of all let me thank you for tons of hints and tips I have gathered from your forum already ! Yet today I am coming up with a question that I have been trying to look up for weeks, and in fact I did not even find my exact problem:

I am offering some files to download. In order to transport them all together in one leap my idea was to pack them in a zip-file, using archive::zip. Everything seems to be working just fine (no warnings, no errors, nothing) untill I try to open the zip file after the download. All programs on all platforms tested (Windows 7, 8, Mac OSX maverick) report a crc error, stating the files were corrupted. downloading the same files one by one, without zipping them works fine. I am posting my code cutting out those parts that deal with form data extraction and such stuff, assuming here can't be the reason.

#!/usr/bin/perl use warnings; use Archive::Zip qw(:ERROR_CODES :CONSTANTS); . . . use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); $zipName = "../downloads/".$verzeichnis."Download.zip"; $zip = Archive::Zip->new(); $index==0; foreach (@zumzippen) { ##use IO::Compress::Zip qw(:all); #use IO::Compress::Zip qw(:ZIP_CM_STORE); ##$status = zip [ @zumzippen ] => "../downloads/".$verzeichnis."Do +wnload.zip"; # , Autoclose => 1; #Method => ZIP_CM_DEFLATE , Level => + Z_NO_COMPRESSION; $member = $zip->addFile( $_ , @dateiliste[$index]); #$member->desiredCompressionMethod( COMPRESSION_STORED ); #$crc = $zip->computeCRC32( $zipName ); #$member->desiredCompressionLevel( 8 ); $index++; } # $zip->addTree("../downloads/$verzeichnis", "$verzeichnis"); #$status = $zip->writeToFileNamed("../downloads/".$verzeichnis.$zi +pName); $status = $zip->writeToFileNamed($zipName); }

As you can see, I also tried compress::zib with the same results. Any hints/help appreciated !

Thanks to Corion I can alter my question:
The zip file on disk is absolutely fine. Trouble starts when downloading it.
Sorry for confusing things and you guys !
Just in case you are not fed up with someone who doesn't even realise which script is causing the error,
Here comes the download script, again just the relevant part.:

#!/usr/bin/perl #use warnings; . . . sub download { use CGI; $html=new CGI; print $html->header(-type => 'application/octet-stream', -attachment = +> $_[1]); open($peunter, "<", $_[0].$_[1]); binmode($peunter); binmode STDOUT; while (read($pointer,$bytes,1024)) { print $bytes; } #@data = <$peunter>; close($peunter); #print "@data"; }

In reply to CRC Error on ZIP Files by SearchigPerl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.