use strict;
use CGI;
my $q=CGI->new();
my $client = $ENV{'REMOTE_ADDR'};
my $buffer;
my $file = $q->param('upload_file');
$client =~ s/\./_/g;
open(FH,"> c:/upload/$client.txt") or die($!);
my $fh = $q->upload('upload_file');
while (<$fh>)
{
print FH;
}
close(FH);
close(LOG);
####
#!perl -w
use LWP::UserAgent;
use HTTP::Request::Common qw/POST/;
my $ua= LWP::UserAgent->new();
my $filename= $ARGV[0];
chomp($filename);
my $url='http://diesel.nci.nih.gov/cgi-bin/store.pl';
my %fields = ("upload_file" => "$filename");
my $results = $ua->post($url ,
content => [upload_file => "$filename"],
enctype => 'multipart/form-data');
if($results->is_success){
print "It's good!\n";
} else {
print "It didn't work.\n";
print $results->status_line();
}
####
50:34 2004] [error] [client 156.40.134.176] Use of uninitialized value in at C:/Apache/scripts/store.pl line 19.
[Wed Nov 10 13:50:34 2004] [error] [client 156.40.134.176] readline() on unopened filehandle at C:/Apache/scripts/store.pl line 19.