cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How can i use curl_formadd or any other function to http post a file without inserting "boundary" tags in html headers?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 18 Sep 2007 22:40:41 +0200 (CEST)

On Tue, 18 Sep 2007, shivpratap wrote:

> I want to post a xml file so i am wondering if i can use CURLOPT_POSTFIELDS
> becuase it requires data instead of a file name.

Yes but you could easily read a file into memory, right?

> I used curl_formadd that adds boundary tags so curl_formadd is out of
> question.

Yes, multipart formposts add boundaries.

> Later on i used curl_easy_setopt(CURLOPT_READDATA,file_ppinter); but it
> failed to post the file andhttp method chaged to GET instead of POST.

Sorry, I don't understand. You can use the callback approach if you want, see
this example:

http://curl.haxx.se/lxr/source/docs/examples/post-callback.c

> This e-mail may contain privileged and confidential information which is the
> property of Persistent Systems Pvt. Ltd.

I hope you give your IT department a hard time for appending such total crap
on all outgoing mails...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-09-18