1CURLINFO_CONTENT_LENGTH_DOWNcLuOrAlD__eTa(s3y)_getinCfUoRLoIpNtFiOo_nCsONTENT_LENGTH_DOWNLOAD_T(3)
2
3
4

NAME

6       CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - get content-length of download
7

SYNOPSIS

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

DESCRIPTION

16       Pass a pointer to a curl_off_t to receive  the  content-length  of  the
17       download. This is the value read from the Content-Length: field. Stores
18       -1 if the size isn't known.
19

PROTOCOLS

21       HTTP(S)
22

EXAMPLE

24       CURL *curl = curl_easy_init();
25       if(curl) {
26         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
27
28         /* Perform the request */
29         res = curl_easy_perform(curl);
30
31         if(!res) {
32           /* check the size */
33           curl_off_t cl;
34           res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &cl);
35           if(!res) {
36             printf("Download size: %" CURL_FORMAT_CURL_OFF_T "\n", cl);
37           }
38         }
39       }
40

AVAILABILITY

42       Added in 7.55.0
43

RETURN VALUE

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

SEE ALSO

49       curl_easy_getinfo(3),  curl_easy_setopt(3), CURLINFO_CONTENT_LENGTH_UP‐
50       LOAD_T(3),
51
52
53
54libcurl 7.76.1                 November 04C,UR2L0I2N0FO_CONTENT_LENGTH_DOWNLOAD_T(3)
Impressum