corrected to match reality better

This commit is contained in:
Daniel Stenberg 2002-06-24 06:14:56 +00:00
parent b9f8e80b14
commit 62527fa98a
1 changed files with 7 additions and 10 deletions

View File

@ -2,7 +2,7 @@
.\" nroff -man [file] .\" nroff -man [file]
.\" $Id$ .\" $Id$
.\" .\"
.TH curl_formadd 3 "15 June 2002" "libcurl 7.9.8" "libcurl Manual" .TH curl_formadd 3 "24 June 2002" "libcurl 7.9.8" "libcurl Manual"
.SH NAME .SH NAME
curl_formadd - add a section to a multipart/formdata HTTP POST curl_formadd - add a section to a multipart/formdata HTTP POST
.SH SYNOPSIS .SH SYNOPSIS
@ -63,15 +63,11 @@ until after curl_easy_cleanup is called.
tells libcurl that the length of the buffer to upload is the value of the tells libcurl that the length of the buffer to upload is the value of the
next parameter. next parameter.
Another possibility to send single or multiple files in one section is to use Another possibility to send options to curl_formadd() is the
\fBCURLFORM_ARRAY\fP that gets a struct curl_forms array pointer as its \fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as
value. Each structure element has a CURLformoption and a char pointer. For the its value. Each curl_forms structure element has a CURLformoption and a char
options only \fBCURLFORM_FILE\fP, \fBCURLFORM_CONTENTTYPE\fP, and pointer. The final element in the array must be a CURLFORM_END. All available
\fBCURLFORM_END\fP (that is used to determine the end of the array and thus options can be used in an array, except the CURLFORM_ARRAY option itself!
must be the option of the last and no other element of the curl_forms array)
are allowed. The effect of this parameter is the same as giving multiple
\fBCURLFORM_FILE\fP options possibly with \fBCURLFORM_CONTENTTYPE\fP after or
before each \fBCURLFORM_FILE\fP option.
Should you need to specify extra headers for the form POST section, use Should you need to specify extra headers for the form POST section, use
\fBCURLFORM_CONTENTHEADER\fP. This takes a curl_slist prepared in the usual way \fBCURLFORM_CONTENTHEADER\fP. This takes a curl_slist prepared in the usual way
@ -166,6 +162,7 @@ defines.
/* Add a buffer to upload */ /* Add a buffer to upload */
curl_formadd(&post, &last, curl_formadd(&post, &last,
CURLFORM_COPYNAME, "name",
CURLFORM_BUFFER, "data", CURLFORM_BUFFER, "data",
CURLFORM_BUFFERPTR, record, CURLFORM_BUFFERPTR, record,
CURLFORM_BUFFERLENGTH, record_length, CURLFORM_BUFFERLENGTH, record_length,