cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Trying to http post xml file - Memory fault(coredump)

From: <man_at_tfhs.net>
Date: Tue, 20 Jun 2006 16:51:14 -0000

stop messing with the Content-Type: header, you HAVE to multi-part post if
you want to include a file. libcurl will take care of this for you.

allan

On Tue, Jun 20, 2006, "Shrestha, Anupama" <Anu.Shrestha_at_Kaman.com> said:

> test.xml is the name of the xml document. I am trying to post and sitting in the same directory where the code is
>
> headerlist = curl_slist_append(headerlist, "Content-Type: application/x-www-form-urlencoded");
> curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
> curl_formadd(&post, &last, CURLFORM_COPYNAME,"project",CURLFORM_FILE,"test.xml",CURLFORM_END);
> curl_easy_setopt(curl, CURLOPT_POST, post);
>
> Do I need to open and read the file?
>
>

-- 
m. allan noah
IT Director, TfHS.net
ph# (804) 355-5489
tf# (866) 724-9722
fx# (804) 355-0477
Received on 2006-06-20