Thanks Mate! I re-wrote everything using WWW::Mechanize and its working now! Change i had done is, instead of having calling the URL, i wrote a HTML page, with the necessary parameters and hosted in a webserver and accessing it via WWW::Mechanize
MY code
use WWW::Mechanize; use HTTP::Cookies; my $user = 'userid'; my $pass = 'password'; my $login_url = 'https://myserver.com/login'; my $upload_url = "http://mylocalserver/File_Upload.html"; my $file = "C:\\ExportFile.csv"; $ENV{HTTPS_PROXY} = 'http://proxyserver' $ENV{HTTPS_PROXY_USERNAME} = 'user'; $ENV{HTTPS_PROXY_PASSWORD} = 'pwd'; $ENV{HTTP_PROXY} = 'http://proxyserver'; $ENV{HTTP_PROXY_USERNAME} = 'usre'; $ENV{HTTP_PROXY_PASSWORD} = 'pwd'; my $cookie_jar = HTTP::Cookies->new(file => 'cookies.txt',autosave => +1); my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech->proxy(https => undef); $mech->proxy(http => undef); $mech->credentials( $user => $pass ); $mech->get( $login_url ); my $response = $mech->response(); $cookie_jar->extract_cookies($response); $cookie_jar->save(); #added new $mech->cookie_jar($cookie_jar); $mech->get($upload_url); $mech->form_number(1); $mech->set_fields(theFile => $file); #'thefile' id control name in the + HTML page $mech->submit(); die unless ($mech->success);

Is it possible to have this HTML page in local machine ex: C:\fileupload.html and access it via WWW::Mechanize? i get protocol error

Thanks for your tips
Cheers
Karthik

In reply to Re^4: Help required regarding HTTP::Request::Common, File upload by KarthikK
in thread Help required regarding HTTP::Request::Common, File upload 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.