CURLINFO_C...GTH_UPLOAD(3)
π CURLINFO_CONTENT_LENGTH_UPLOAD π
okay bestie, so this one's from the libcurl corner of the Library Functions Manual β yes THE libcurl, the one that's been carrying the whole internet on its back since forever. buckle up π
β¨ NAME β¨
CURLINFO_CONTENT_LENGTH_UPLOAD β literally just the specified size of the upload. that's it. that's the whole vibe. π
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_LENGTH_UPLOAD,
double *content_length);
πΈ DESCRIPTION πΈ
so you pass in a pointer to a double, and it gets filled with the specified size of the upload. simple as that, no cap. π«Ά
since 7.19.4, if the size isn't known, this thing just returns -1. iconic behavior honestly.
also quick heads up: CURLINFO_CONTENT_LENGTH_UPLOAD_T(3) is the newer replacement and it returns a way more sensible variable type. so likeβ¦ do with that information what you will π
π PROTOCOLS π
this functionality affects all supported protocols. all of them. every single one. ate and left no crumbs π
π§ EXAMPLE π§
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* Perform the upload */
result = curl_easy_perform(curl);
if(!result) {
/* check the size */
double cl;
result = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD, &cl);
if(!result) {
printf("Size: %.0f\n", cl);
}
}
}
}
look at that little main character doing its thing πβ¨
π DEPRECATED π
deprecated since 7.55.0. she's a legacy icon but she's still deprecated, bestie β know the difference π
π AVAILABILITY π
added in curl 7.6.1. vintage. retro. lowkey a historical artifact at this point π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK β slay. non-zero means an error occurred, no cap, go check libcurl-errors(3) for the tea π₯
π SEE ALSO π
and that's the whole page, bestie π«Ά brought to you by libcurl, dated 2026-10-12, living that CURLINFO_C...GTH_UPLOAD(3) life to the very last line πβ¨ go forth and upload responsibly πΈ
π¦ 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