cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: question regarding CURLOPT_WRITEFUNCTION & CURLOPT_WRITEDATA

From: Tor Arntsen <tor_at_spacetec.no>
Date: Wed, 22 Oct 2008 12:00:57 +0200

On Wed, Oct 22, 2008 at 10:27, Jan <haihappn_at_gmail.com> wrote:

> You are right. with fwrite it works, but not with fputs..

You can't use fputs on binary data like jpgs and the like. fputs works
with strings, in other words
it will terminate as soon as it sees a binary zero. From the man page:

       fputs() writes the string s to stream, without its trailing '\0'.
Received on 2008-10-22