Here is a upload-w-auth recipe that works. (I wrote this for https, but test it here as a http.... don't get confused by it).
#!/usr/bin/perl use warnings; use strict; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Request::Common qw(POST); #test on plain http my $https_login = 'http://zentara.zentara.net/~zentara/cgi-bin/uploads +'; my $https_post = 'http://zentara.zentara.net/~zentara/cgi-bin/uploads/ +up1.cgi'; my $https_user = 'zentara'; my $https_pass = 'foobar'; my $file = 'testout.tgz'; &postHTTPS(); sub postHTTPS { my $ua = new LWP::UserAgent; $ua->protocols_allowed( [ 'http'] ); $ua->cookie_jar(HTTP::Cookies->new(file =>".cookies.txt",autos +ave => 1)); #setup request my $req = POST($https_post, Content_Type => 'multipart/form-data', Content =>[ file =>[ $file ], ], ); my $user = 'zentara'; my $pass = 'foobar'; $req->authorization_basic($user, $pass); #do post my $response = $ua->request($req); if ($response->is_error()) { printf " %s\n", $response->status_line; print "https request error!\n"; } else { my $content = $response->content(); print "$content\n"; } if ( $response->is_success ) { print $response->as_string; }else { print $response->status_line; } }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: missing credentials when uploading file with POST by zentara
in thread missing credentials when uploading file with POST by helix

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.