CURLINFO_SIZE_DOWNLOAD(3)
π CURLINFO_SIZE_DOWNLOAD(3) π
okay so bestie, welcome to the CURLINFO_SIZE_DOWNLOAD page β this one lives in the curl library functions manual, and it's literally just "how many bytes did I download," but make it β¨dramaticβ¨.
πΈ NAME πΈ
CURLINFO_SIZE_DOWNLOAD β number of downloaded bytes π
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_DOWNLOAD, double *dlp);
π¦ DESCRIPTION π¦
So here's the vibe: you pass a pointer to a double, and curl fills it with the total amount of bytes that were downloaded. That's it. That's the whole personality. π
Important tea though β the amount is only for the latest transfer, and it gets reset again for each new transfer. So don't be out here thinking it's a lifetime total, because it is not, and it will humble you. π
It counts actual payload data, aka what everyone commonly calls the body. All the meta and header data is excluded and not included in this number. So it's just the good stuff, none of the packaging. π¦
Also, quick heads up: CURLINFO_SIZE_DOWNLOAD_T(3) is the newer replacement that returns a more sensible variable type. So likeβ¦ she's the upgraded version, iykyk. π
π PROTOCOLS π
This functionality affects all supported protocols. yes, all of them. no gatekeeping here. π«Ά
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* Perform the request */
result = curl_easy_perform(curl);
if(!result) {
/* check the size */
double dl;
result = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &dl);
if(!result) {
printf("Downloaded %.0f bytes\n", dl);
}
}
}
}
look at her go. iconic behavior honestly. β
π DEPRECATED π
Deprecated since 7.55.0. yeah she's giving legacy main character energy β still works, but the new girl is right there. π
π§ AVAILABILITY π§
Added in curl 7.4.1. she's been around a minute. π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK. non-zero means an error occurred β go check libcurl-errors(3) for the full breakdown, bestie. π₯
π SEE ALSO π
CURLINFO_SIZE_DOWNLOAD_T(3)CURLINFO_SIZE_UPLOAD_T(3)CURLOPT_MAXFILESIZE(3)curl_easy_getinfo(3)curl_easy_setopt(3)
k that's the whole page, mwah π β brought to you by libcurl, dated 2026-10-12, and yes the original footer said CURLINFO_SIZE_DOWNLOAD(3) so we're keeping that energy. go download some bytes responsibly, bestie πΈπ¦π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms