in reply to Re^6: CRC Error on ZIP Files
in thread CRC Error on ZIP Files
whether due to the size of one file or due to the number of files"the number of files" - as in "the number of files within the archive", right? Because download() only handles one file at a time.
Any clues ?Come to think of it, this could be a server configuration issue (google "mod_gzip" OR "mod_deflate" zip corruption). What happens if you put a (preferably large) ZIP archive somewhere within the document root and download it using the direct link?
Well, anyway, try this slightly modified version of download:
sub download { my $filename = $_[0].$_[1]; use CGI; $html=new CGI; $| = 1; print $html->header( -type => 'application/zip', -charset => 'binary', -attachment => $_[1], -Content_length => -s $filename); open($peunter, "<", $filename); binmode($peunter); binmode STDOUT; while (read($peunter,$bytes,1024)) { print $bytes; } close($peunter); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: CRC Error on ZIP Files
by SearchigPerl (Acolyte) on Mar 13, 2014 at 21:33 UTC | |
by SearchigPerl (Acolyte) on Mar 27, 2014 at 16:05 UTC | |
by hazylife (Monk) on Mar 27, 2014 at 16:49 UTC |