Hello everyone,
In continuation with my post
how to upload a file to a secured website? and
How to authenticate and upload file to a secured server
i was able to figure out to go out of proxy to access HTTPS website by simply setting
$ua->proxy(https => undef); and taking proxy from Env varaibles
Now i am able to authenitcate to a website and get the session cookie and pass it to another page for uploading a file. But i see that the file is not being uploaded atall and i always gets the return from the website as error in file importing. below is part of the code i use for upload
request=POST $upload_url,Content_Disposition => 'multipart/form-data',
Content_Type=> 'application/vnd.ms-excel',
Content_Type=> 'application/vnd.ms-excel',
Content_Length=> 1024,
submit => 1,
Content => [ filename=>[$file ] ];
I am uploading a CSV file to this website.
Also, I see this error <BR
Content-Length header value was wrong, fixed at C:/Perl/lib/LWP/Protocol/http.pm line 189.
in my log
Is this the reason why the file is not uploaded? also how to set correct content-length?
>
This webpage link can only be access via POST method and requires a file as parameter and returns a text file which contains the status message
>
Thanks a lot in advance
Karthik
20071111 Janitored by Corion: Linkified links, made links local, as per Writeup Formatting Tips
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.