Thanks again! below is the code
#!/usr/bin/perl use warnings; use strict; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Request::Common qw(POST); my $upload_url = 'https://mysite.com/import.do'; my $login_url = 'https://mysite.com/login.do '; my $https_user = 'ABC'; my $https_pass = 'ABC'; my $file = 'File_2007_10_15_14_21_02.csv'; &postHTTPS(); sub postHTTPS { my $ua = new LWP::UserAgent(keep_alive=>1); $ua->proxy(https => 'http://ourproxyserver'); my $request = new HTTP::Request ("GET" => $login_url ); $request->authorization_basic($https_user, $https_pass); #$ua->protocols_allowed( [ 'https'] ); $ua->cookie_jar(HTTP::Cookies->new(file =>".cookies.txt",autos +ave => 1)); # $request->proxy_authorization_basic($https_user, $https_pass); #setup request print "before posting\n"; my $req=POST ($upload_url,Content_Type => 'multipart/form-data +', Content_Type => [ submit => 1, Content => [ $file ] ]); print "after posting\n"; 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"; } print ""; if ( $response->is_success ) { print $response->as_string; }else { print $response->status_line; } }
As you might know I cannot give my exact site name due to some reasons. I think when i call the upload page it goes to the login page whre we have to provide the username and password (not in the form but in the IE authentication box) when i execute the above code I dont get any error! Have I missed anything in the code?

In reply to Re^4: how to upload a file to a secured website? by KarthikK
in thread how to upload a file to a secured website? by KarthikK

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.