in reply to Re: Archive::Zip with cgi empty zip file
in thread Archive::Zip with cgi empty zip file
This is great, there's so much more I'm going to do with this code now that its making the zip file with content.#!/usr/bin/perl -w use Archive::Zip qw(:ERROR_CODES :CONSTANTS); use CGI qw(:standard :nph redirect); if (my $id = param('link')){ $obj = Archive::Zip->new(); my $file_member = $obj->addFile( $id ); if ($obj->writeToFileNamed('download2.zip') != AZ_OK) { print header(type => 'text/plain'); print "Error in archive creation!"; #error checking } else { print redirect('http://domain.com/files/download2.zip'); } }
|
|---|