Note: there is a cache generated after login as follows: Set-Cookie: sysauth=ACA415DA69DD4170D34D2DDCE2B610F5; path=/cgi-bin/luci/;stok=44F89C9B8E1EB34F9D379B5162763EAF Location: /cgi-bin/luci/;stok=44F89C9B8E1EB34F9D379B5162763EAF/engineer So I need to use the token when doing the upload. The source is follow by "zentaras" #!/usr/bin/perl use warnings; use strict; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Request::Common qw(POST); #test on plain http my $http_post = 'http://192.168.1.1/cgi-bin/luci/engineer/advanced/diagnostics/upgrade/'; my $http_user = 'engineer'; my $http_pass = 'ARC$eng&123'; my $file = 'rev1-54.zip'; &postHTTP(); sub postHTTP { my $ua = new LWP::UserAgent; $ua->protocols_allowed( [ 'http'] ); $ua->cookie_jar(HTTP::Cookies->new(file =>".cookies.txt",autosave => 1)); #setup request my $req = POST($http_post, Content_Type => 'multipart/form-data', Content =>[ file =>[ $file ], ], ); my $user = 'engineer'; my $pass = 'ARC$eng&123'; $req->authorization_basic($user, $pass); #do post my $response = $ua->request($req); if ($response->is_error()) { printf " %s\n", $response->status_line; print "http request error!\n"; } else { my $content = $response->content(); print "$content\n"; } if ( $response->is_success ) { print $response->as_string; }else { print $response->status_line; } }