diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/libcurl/curl_formadd.3 | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/docs/libcurl/curl_formadd.3 b/docs/libcurl/curl_formadd.3 index c8055afb9..693ca0f2e 100644 --- a/docs/libcurl/curl_formadd.3 +++ b/docs/libcurl/curl_formadd.3 @@ -35,28 +35,28 @@ is made for file upload, there are also a stored CONTENT-TYPE and a FILENAME. Below here, we'll discuss on what options you use to set these properties in the parts you want to add to your post. .SH OPTIONS -.B CURLFORM_COPYNAME +.IP CURLFORM_COPYNAME followed by string is used to set the name of this part. libcurl copies the given data, so your application doesn't need to keep it around after this function call. If the name isn't zero terminated properly, or if you'd like it to contain zero bytes, you need to set the length of the name with \fBCURLFORM_NAMELENGTH\fP. -.B CURLFORM_PTRNAME +.IP CURLFORM_PTRNAME followed by a string is used for the name of this part. libcurl will use the pointer and refer to the data in your application, you must make sure it remains until curl no longer needs it. If the name isn't zero terminated properly, or if you'd like it to contain zero bytes, you need to set the length of the name with \fBCURLFORM_NAMELENGTH\fP. -.B CURLFORM_COPYCONTENTS +.IP CURLFORM_COPYCONTENTS followed by a string is used for the contents of this part, the actual data to send away. libcurl copies the given data, so your application doesn't need to keep it around after this function call. If the data isn't zero terminated properly, or if you'd like it to contain zero bytes, you need to set the length of the name with \fBCURLFORM_CONTENTSLENGTH\fP. -.B CURLFORM_PTRCONTENTS +.IP CURLFORM_PTRCONTENTS followed by a string is used for the contents of this part, the actual data to send away. libcurl will use the pointer and refer to the data in your application, you must make sure it remains until curl no longer needs it. If @@ -64,11 +64,14 @@ the data isn't zero terminated properly, or if you'd like it to contain zero bytes, you need to set the length of the name with \fBCURLFORM_CONTENTSLENGTH\fP. -.B CURLFORM_FILECONTENT +.IP CURLFORM_CONTENTSLENGTH +followed by a long setting the length of the contents. + +.IP CURLFORM_FILECONTENT followed by a file name, makes that file read and the contents will be used in as data in this part. -.B CURLFORM_FILE +.IP CURLFORM_FILE followed by a file name, makes this part a file upload part. It sets the file name field to the actual file name used here, it gets the contents of the file and passes as data and sets the content-type if the given file match one of @@ -77,32 +80,33 @@ send one or more files in one part by providing multiple \fBCURLFORM_FILE\fP arguments each followed by the filename (and each CURLFORM_FILE is allowed to have a CURLFORM_CONTENTTYPE). -.B CURLFORM_CONTENTTYPE +.IP CURLFORM_CONTENTTYPE followed by a pointer to a string with a content-type will make curl use this given content-type for this file upload part, possibly instead of an internally chosen one. -.B CURLFORM_FILENAME +.IP CURLFORM_FILENAME followed by a pointer to a string to a name, will make libcurl use the given name in the file upload part, instead of the actual file name given to \fICURLFORM_FILE\fP. -.B BCURLFORM_BUFFER +.IP BCURLFORM_BUFFER followed by a string, tells libcurl that a buffer is to be used to upload data instead of using a file. The given string is used as the value of the file name field in the content header. -.B CURLFORM_BUFFERPTR +.IP CURLFORM_BUFFERPTR followed by a pointer to a data area, tells libcurl the address of the buffer containing data to upload (as indicated with \fICURLFORM_BUFFER\fP). The buffer containing this data must not be freed until after -\fIcurl_easy_cleanup(3)\fP is called. +\fIcurl_easy_cleanup(3)\fP is called. You must also use +\fICURLFORM_BUFFERLENGTH\fP to set the length of the given buffer area. -.B CURLFORM_BUFFERLENGTH +.IP CURLFORM_BUFFERLENGTH followed by a long with the size of the \fICURLFORM_BUFFERPTR\fP data area, tells libcurl the length of the buffer to upload. -.B CURLFORM_ARRAY +.IP CURLFORM_ARRAY Another possibility to send options to curl_formadd() is the \fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as its value. Each curl_forms structure element has a CURLformoption and a char @@ -110,7 +114,7 @@ pointer. The final element in the array must be a CURLFORM_END. All available options can be used in an array, except the CURLFORM_ARRAY option itself! The last argument in such an array must always be \fBCURLFORM_END\fP. -.B CURLFORM_CONTENTHEADER +.IP CURLFORM_CONTENTHEADER specifies extra headers for the form POST section. This takes a curl_slist prepared in the usual way using \fBcurl_slist_append\fP and appends the list of headers to those libcurl automatically generates. The list must exist while |