Hi fellow Monks
I'm trying to put a file on the web server, the file is in the same folder as the script, but I'm doing something wrong
Can you please point out where I'm going wrong
Kind Regards
#!c:\perl\bin -w
use LWP::UserAgent;
use HTTP::Request::Common;
my $url = "http://192.168.0.200/maintenance/instructions";
my $fname = "test.txt";
my $ua = LWP::UserAgent->new();
my $req = POST $url,
Content_Type => 'form-data',
Content => [
submit => 1,
upfile => [ $fname ]
];
my $response = $ua->request($req);
if ($response->is_success()) {
print "OK: ", $response->content;
} else {
print "Failed: ", $response->as_string;
}
exit;