On Sun, 14 Jul 2002 13:04:49 -0400, [EMAIL PROTECTED] (Zentara)
wrote:
>I don't think you can do this easily. The http protocol is setup so that
Forget that, I got industrious this afternoon, and looked into how to do
it. Here it is. It works great, sends 1 file right after the other.
download-multi.cgi
########################################
#!/usr/bin/perl
$boundary_string = "\n" . "--End" . "\n";
$end_of_data = "\n" . "--End--" . "\n";
@file_list = ("test.tgz","test1.tgz","test2.tgz");
print<<EOH;
Content-type: multipart/x-mixed-replace\;boundary=End
EOH
foreach $file (@file_list){
&send_file ($file);
print $boundary_string;
}
print $end_of_data;
exit(0);
sub send_file
{
local ($file) = @_;
if ( (open (FILE, "< $file")) ) {
print<<EOF;
Content-type: application/octet-stream
Content-Disposition: attachment\; filename=$file
EOF
binmode FILE;
print <FILE>;
close (FILE);
}else{print "Cannot open file $file!"}
}
####################################################
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]