1CURLINFO_CONTENT_LENGTH_UPLOAD(3)   libcurl  CURLINFO_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_CONTENT_LENGTH_UPLOAD,
12                                  double *content_length);
13

DESCRIPTION

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

PROTOCOLS

22       All
23

EXAMPLE

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

AVAILABILITY

43       Added in 7.6.1. Deprecated since 7.55.0.
44

RETURN VALUE

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

SEE ALSO

50       curl_easy_getinfo(3),        curl_easy_setopt(3),         CURLINFO_CON‐
51       TENT_LENGTH_DOWNLOAD_T(3),
52
53
54
55libcurl 8.2.1                   April 26, 2023CURLINFO_CONTENT_LENGTH_UPLOAD(3)
Impressum