Hi

Thanks for your previous help with this everybody but I still can't get this to work. I want to POST a file to a https server. GET is working fine.

This is the form on the server:

<form action="https://<address>/cgi-bin/upload.pl" method="post" encty +pe="multipart/form-data"> <input type="File" name="FILE1" size="40"> <input type="File" name="FILE2" size="40"> <input type="File" name="FILE3" size="40"> <input type="File" name="FILE4" size="40"> <input type="File" name="FILE5" size="40"> <input type="File" name="FILE6" size="40"> <input type="File" name="FILE7" size="40"> <input type="File" name="FILE8" size="40"> <input type="File" name="FILE9" size="40"> <input type="File" name="FILE10" size="40"> <input type="Submit" value=" Upload " > <input type="reset" value=" R +eset ">

This is my code (I have tried many variations of this):

my $url = 'https://<address>/cgi-bin/upload.pl'; my $response = $browser->post($url,Content_Type => "multipart/form-data" Content => [file => ['data.txt']]); print ($response->status_line);

I get an "OK" response but the file never gets to the server. Can you see anything wrong?

Thanks

Jonathan

Edited by Chady -- added code tags around form.


In reply to How do I upload a file to a https server? by Anonymous Monk

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.