df99aa687afdddab4303e3ba6292d2551205412e
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_UPLOAD.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_UPLOAD 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_UPLOAD \- enable data upload
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UPLOAD, bool upload);
30 .SH DESCRIPTION
31 The long parameter \fIupload\fP set to 1 tells the library to prepare for and
32 perform an upload. The \fICURLOPT_READDATA(3)\fP and
33 \fICURLOPT_INFILESIZE(3)\fP or \fICURLOPT_INFILESIZE_LARGE(3)\fP options are
34 also interesting for uploads. If the protocol is HTTP, uploading means using
35 the PUT request unless you tell libcurl otherwise.
36
37 Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
38 You can disable this header with \fICURLOPT_HTTPHEADER(3)\fP as usual.
39
40 If you use PUT to a HTTP 1.1 server, you can upload data without knowing the
41 size before starting the transfer if you use chunked encoding. You enable this
42 by adding a header like "Transfer-Encoding: chunked" with
43 \fICURLOPT_HTTPHEADER(3)\fP. With HTTP 1.0 or without chunked transfer, you
44 must specify the size.
45 .SH DEFAULT
46 0, default is download
47 .SH PROTOCOLS
48 Most
49 .SH EXAMPLE
50 TODO
51 .SH AVAILABILITY
52 Always
53 .SH RETURN VALUE
54 Returns CURLE_OK
55 .SH "SEE ALSO"
56 .BR CURLOPT_PUT "(3), " CURLOPT_READFUNCTION "(3), "
57 .BR CURLOPT_INFILESIZE_LARGE "(3), "