#!/usr/local/bin/perl ##################################################### # This script was created by Chris Thompson. You # can redistribute this script only if this note is # up and the link at the bottom of the page is still # intact. ©opyrighted 2000. # Script Name: Zipper # Version: 1.0 # E-mail: Chris@refraxion.com # Homepage: http://cgi-place.refraxion.com ##################################################### $file = 'zip.pl'; # The name of this file $root = 'http://hammer.prohosting.com/~seether/cgi-bin/'; # The full path to the directory this script is in # No more editing needed, but you can if you want to ##################################################### # The stuff that makes the script tick print "Content-Type: text/html\n\n"; read(STDIN, $input,$ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $input); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $IN{$name} = $value; } ##################################################### # The main page html if ($ENV{'CONTENT_LENGTH'} eq ""){ print < Zipper
Delete the text boxes you will not use.

File 1:

File 2:

File 3:

File 4:

File 5:

Zipped Name: .zip

This script was created by Chris Thompson, a product of Cgi-Place. Copyright 2000.
EOF } ##################################################### # If the user wants to zp the files, do it if ($IN{'action'}){ @zip = `zip -j $IN{´fname´}.zip $IN{´1'} $IN{´2'} $IN{'3'} $IN{'4'} $IN{'5'}`; @info = `unzip -l $IN{´fname´}.zip`; &done; } sub done{ print < Zipper EOF foreach $i (@zip){ print "$i
"; } print "

"; foreach $i (@info){ print "$i
"; } print <

Your files have been zipped. To add more files to the zipped file, use the same Zip name when you zip files.
EOF exit; } # We're done