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