cURL / Mailing Lists / curl-library / Single Mail

curl-library

Help : Form_add multipart/form-data post problem

From: <rakesh.sharma2_at_wipro.com>
Date: Wed, 10 Dec 2008 12:27:42 +0530

Hi,
        I have a problem posting Multipart/form-data
 
     From Live HTTP Header :
    Content-Disposition: form-data; name="name:_id11";
filename="Inputs.txt"
    Content-Type: text/plain
    /*
    contentsof the file
    :
    :
    */
 
 
Inputs.txt is the file which I have to upload to the URL, it was giving
me Expectation Error
code example is as follows
ret=curl_formadd(&formpost, &lastptr,CURLFORM_COPYNAME,
"name:_id11",CURLFORM_FILE,"D:\\Scripts\\Inputs.txt",CURLFORM_END);

ret=curl_formadd(&formpost,&lastptr,CURLFORM_COPYNAME,
"filename",CURLFORM_COPYCONTENTS,"Inputs.txt",CURLFORM_END);

and then ,

curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);

For removing expectation error I appended "Expect:" to the header list.

Now I am getting no Expectation error but file is not getting uploaded
to the HTTP URL which is "some.jsf "

Please help me in this regard.

How to upload the file, as the name field is name:_id11, it can be
directly used to set the values using.

Please help me out of this blocked situation.

Thank's in advance

Rakesh Sharma

Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
Received on 2008-12-10