BKoT has asked for the wisdom of the Perl Monks concerning the following question:
Thanks, -BKoT-#!/usr/bin/perl -w use CGI ':standard'; use String::CRC32; use Archive::Zip qw(:ERROR_CODES :CONSTANTS); $myname = $0; $myname =~ s/\///g; $myname =~ s/usrlocalweb//; $myname =~ s/.cgi//; $zip = Archive::Zip->new(); print "Content-disposition: filename=$myname.zip\n"; print "Content-type: Application/zip\n\n"; open (LISTIT, "<$myname.txt"); while (<LISTIT>) { $_ =~ s/\n//g; push @filenames,$_; } $filecount = ($#filenames)+1; close (LISTIT); for ($loop=0; $loop < $filecount; $loop++) { my $member = $zip->addFile( $filenames[$loop] ); $member->desiredCompressionMethod( COMPRESSION_DEFLATED ); $member->desiredCompressionLevel( 9 ); } $output = $zip->writeToFileHandle( STDOUT ); exit $output;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Threading http file transfers
by iburrell (Chaplain) on Dec 20, 2002 at 18:09 UTC |