in reply to File not posted to a HTTPS website

I'm sure you don't need to set Content_Length. HTTP::Request do all stuff for you automatically.

Also why you specify Content_Type two times?

And finally: why you place [] around $file?

Try this:

$ua->post( $upload_url, Content_Type=> 'application/vnd.ms-excel', Con +tent => $file );

Replies are listed 'Best First'.
Re^2: File not posted to a HTTPS website
by KarthikK (Sexton) on Nov 07, 2007 at 07:13 UTC
    Thanks for your reply.
    The content_type was a copy paste problem. I have it only once in my code.
    Also this piece of code you had suggested did not work and i get the following error
    You need a request object, not a HTTP::Response object at Upload_V6.pl line 107
    My code always gives this erorr
    Content-Length header value was wrong, fixed at C:/Perl/lib/LWP/Protocol/http.pm line 189.

      Then get out a network sniffer or use use LWP::Debug qw(+) to see what gets sent over the wire.

      There is no way we can help you debug this situation, as you do not show us the whole code, especially line 107, nor information on the data, nor what Content-Length value you sent and why LWP::Protocol::http feels the need to override it.

      That warning might be a red herring, but you don't tell us what the server sends as result page after your upload, and you also don't tell what the server error logs say.

        Thanks once again.
        The server sends us a text file as the acknowlegement after upload. What i see in the text file is default error information i.e, File not imported.
        I use LWP::Debug qw(+) and this how i found out this error:
        Content-Length header value was wrong, fixed at C:/Perl/lib/LWP/Protocol/http.pm line 189.

        My assumption is that the file is not being sent to the website atall.

        I dont have access to the server logs as this server is not maintained by us
        Thanks once again
        Karthik