#!/usr/bin/perl -w #use strict; use Archive::Zip qw(:ERROR_CODES :CONSTANTS); use CGI qw(:nph); my $q = CGI->new(); my $id; if ($id = $q->param('link')){ my $obj = Archive::Zip->new(); my $file_member = $obj->addFile( $id ); if ($obj->writeToFileNamed('download.zip') != AZ_OK) { print $q->header(type => 'text/plain'); print "Bad something or other!"; } else { print $q->redirect('http://domain.com/files/download.zip'); } }