use LWP::UserAgent; use HTTP::Request::Common qw(POST); $ua = new LWP::UserAgent; $req = POST ( 'http://www.page.com/app?cmd=upload', Content_Type => 'form-data', Content => [ name => 'value', name => 'value', file => ["/path/to/file.txt"], ] ); $response = $ua->request($req); #### $filename = "c:/test.pl"; use HTTP::Request::Common qw(POST); use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = POST ('http://www.environet.gov.on.ca/dwws-app/DWWSApp?cmd=UploadSubmPage.uploadSubm', Content_Type => 'form-data', Content => [ works_id => '2353245', lab_id => '456436', filename => [$filename] ] ); print $req->as_string; # looks OK my $res = $ua->request($req); print $res->as_string;