cURL / Mailing Lists / curl-library / Single Mail


RE: HELP: problem with curl_easy_perform

From: Daniel Stenberg <>
Date: Fri, 7 Sep 2001 08:26:58 +0200 (MET DST)

On Thu, 6 Sep 2001, Christie, Darren wrote:

(*please* don't take curl matters off the mailing list just because I replied
to your mail. This is CC'ed back to the libcurl mailing list, as this is a
libcurl matter.)

> > We'd be very interested in knowing what options you used as
> > they're very likely to affect, if not cause, this problem.

> curl_easy_setopt(curl,CURLOPT_PROXY,strProxyServer);
> curl_easy_setopt(curl,CURLOPT_PROXYUSERPWD,strProxyUserPwd);
> curlRes = curl_easy_setopt(curl,CURLOPT_HEADER);
> curlRes = curl_easy_setopt(curl,CURLOPT_ERRORBUFFER);
> curlRes = curl_easy_setopt(curl, CURLOPT_MUTE, 1);
> curlRes = curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
> curlRes = curl_easy_setopt(curl,CURLOPT_FILE,bodyfile);
> curlRes = curl_easy_setopt(curl,CURLOPT_WRITEHEADER,cookiefile);
> curlRes = curl_easy_setopt(curl,CURLOPT_COOKIEFILE,COOKIE_FILENAME);
> curlRes = curl_easy_setopt(curl,CURLOPT_POSTFIELDS,strFormfields);
> curlRes = curl_easy_setopt(curl, CURLOPT_POST,1);


my previous guess:

> >* You use the option CURLOPT_FILE but not CURLOPT_WRITEFUNCTION

So, you actually did use CURLOPT_FILE but not CURLOPT_WRITEFUNCTION! This is
unfortunately not a successful combination on windows machines.

Since you use CURLOPT_FILE, you *MUST* use CURLOPT_WRITEFUNCTION as well. If
you correct this, I'm positive you'll have your program working in no time.

This fact is mentioned in the FAQ (item 5.5) as well as in the
curl_easy_setopt() docs for the CURLOPT_FILE option.

    Daniel Stenberg -- curl groks URLs --
Received on 2001-09-07