in reply to how i can running this achive::zip program in CGI?
poj#!c:/perl/bin/perl -w use strict; use Archive::Zip; use CGI; # run the program eval { my $zipname = 'c:/file.zip'; my $destinationDirectory = 'c:/temp/'; my $zip = Archive::Zip->new($zipname); foreach my $member ($zip->members) { next if $member->isDirectory; (my $extractName = $member->fileName) =~ s{.*/}{}; $member->extractToFileNamed("$destinationDirectory/$extractName"); } }; # result my $msg; if ($@) { $msg = "Error : $@"; } else { $msg = "Zip program ran OK "; } # html page my $q = new CGI; print $q->header( "text/html" ), $q->start_html( -title=>"Zip Program" ), $q->h2( $msg ), $q->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: how i can running this achive::zip program in CGI?
by Anonymous Monk on Jan 21, 2003 at 08:48 UTC |