cURL / Mailing Lists / curl-library / Single Mail


Differences between the buffer-oriented curl_fromadd() parameters

From: Holger Rauch <>
Date: Tue, 1 Oct 2002 14:59:13 +0200 (CEST)


Even after having read the curl_formadd() man page, the difference between


is not clear to me. I realize that when using CURLFORM_BUFFERPTR, I must
make sure that the data is available until curl_easy_cleanup() has
performed its job. For CURLFORM_PTRCONTENTS, it's only mentioned that an
optional length parameter may be specified, but I don't see the difference
to CURLFORM_COPYCONTENTS, for example. Does the following command (taken
from the example in the man page) upload two buffers (data AND
record)? ("record" doesn't seem to specified in the example, so I don't
know what it is.)

curl_formadd(&post, &last,
                   CURLFORM_COPYNAME, "name",
                   CURLFORM_BUFFER, "data",
                   CURLFORM_BUFFERPTR, record,
                   CURLFORM_BUFFERLENGTH, record_length,

Is this equivalent to (provided that "record" is omitted)

curl_formadd(&post, &last,
             CURLFORM_COPYNAME, "name",
             CURLFORM_PTRCONTENTS, "data",


curl_formadd(&post, &last,
             CURLFORM_COPYNAME, "name",
             CURLFORM_COPYCONTENTS, "data",


curl_formadd(&post, &last,
             CURLFORM_COPYNAME, "name",
             CURLFORM_BUFFERPTR, "data",

Get the point I'm trying to make?

Could anybody please enlighten me when to use which of these options?

Thanks in advance for any info!

Kind regards,


This email is sponsored by: DEDICATED SERVERS only $89!
Linux or FreeBSD, FREE setup, FAST network. Get your own server
today at
Received on 2002-10-01