Hi

I am currently working on automating file submission to a portal. I face a problem regarding content types. My request is like

$filename='testfile'; $req=POST 'https://www.abcd.com/fileUpload.aspx', Content_Type=>'form- +data', Content => [file1=>["$filename"],file4=>[""],file5=>[""]];
I expect a request something like
--xYzZY Content-Disposition: form-data; name="file1"; filename="testfile " Content-Type: application/octet-stream Test File Contents --xYzZY Content-Disposition: form-data; name="file4" filename="" --xYzZY Content-Disposition: form-data; name="file5" filename=""
since the data i captured using a HTTP Sniffer showed the request was like this. But the request it is generating is like
--xYzZY Content-Disposition: form-data; name="file1"; filename="testfile " Content-Type: application/octet-stream Test File Contents --xYzZY Content-Disposition: form-data; name="file4" --xYzZY Content-Disposition: form-data; name="file5"
Please help me figure out how to create a request like this. Thanks in advance

In reply to Query regarding HTTP:Request by gjwilson21

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.