1CURLINFO_CONTENT_LENGTH_UPLOcAuDr(l3_)easy_getinfo oCpUtRiLoInNsFO_CONTENT_LENGTH_UPLOAD(3)
2
3
4

NAME

6       CURLINFO_CONTENT_LENGTH_UPLOAD - get the specified size of the upload
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode       curl_easy_getinfo(CURL       *handle,      CURLINFO_CON‐
12       TENT_LENGTH_UPLOAD,
13                                  double *content_length);
14

DESCRIPTION

16       Pass a pointer to a double to receive the specified size of the upload.
17       Since 7.19.4, this returns -1 if the size isn't known.
18
19       CURLINFO_CONTENT_LENGTH_UPLOAD_T(3) is a newer replacement that returns
20       a more sensible variable type.
21

PROTOCOLS

23       All
24

EXAMPLE

26       CURL *curl = curl_easy_init();
27       if(curl) {
28         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
29
30         /* Perform the upload */
31         res = curl_easy_perform(curl);
32
33         if(!res) {
34           /* check the size */
35           double cl;
36           res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD, &cl);
37           if(!res) {
38             printf("Size: %.0f\n", cl);
39           }
40         }
41       }
42

AVAILABILITY

44       Added in 7.6.1
45

RETURN VALUE

47       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
48       if not.
49

SEE ALSO

51       curl_easy_getinfo(3),         curl_easy_setopt(3),        CURLINFO_CON‐
52       TENT_LENGTH_DOWNLOAD_T(3),
53
54
55
56libcurl 7.66.0                   June 15, 2017CURLINFO_CONTENT_LENGTH_UPLOAD(3)
Impressum