CURLINFO_SIZE_UPLOAD(3)

πŸ¦‹ CURLINFO_SIZE_UPLOAD(3) πŸ¦‹

okay bestie so this one's from the libcurl Library Functions Manual and it's called CURLINFO_SIZE_UPLOAD β€” yes it's literally in all caps, that's just how these things roll πŸ’…


✨ NAME ✨

CURLINFO_SIZE_UPLOAD β€” the number of uploaded bytes, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SIZE_UPLOAD,
                           double *uploadp);

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea: you pass in a pointer to a double, right? And that double gets filled with the total amount of bytes that were uploaded ✨

that's it, that's the whole function, she's simple and she serves 🫢

but like… heads up bestie πŸ‘€ β€” CURLINFO_SIZE_DOWNLOAD... no wait, CURLINFO_SIZE_UPLOAD_T(3) is the newer replacement, and it returns a more sensible variable type. so this one's the older sister, cute but kinda dated πŸ’€


🌈 PROTOCOLS 🌈

this functionality affects all supported protocols β€” every single one, no cap πŸ‘‘


🧚 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) {
      double ul;
      result = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &ul);
      if(!result) {
        printf("Uploaded %.0f bytes\n", ul);
      }
    }
  }
}

like look at her go 😭 init, setopt, perform, getinfo β€” the whole little routine, iconic behavior fr fr πŸ“


πŸ™ˆ DEPRECATED πŸ™ˆ

Deprecated since 7.55.0.

sad girl hours πŸ₯² she's been deprecated, so like… maybe use the newer one if you're starting fresh? but the info's right there if you need it πŸ’œ

⭐ AVAILABILITY ⭐

Added in curl 7.4.1 β€” she's an OG, been around since forever πŸ‘‘


πŸŽ€ RETURN VALUE πŸŽ€

curl_easy_getinfo(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK, non-zero means an error occurred β€” see libcurl-errors(3) for the full breakdown πŸ”₯


πŸ’… SEE ALSO πŸ’…


okay that's the page!! πŸ¦‹ go forth and count those bytes bestie, and remember β€” this whole thing came to you straight from libcurl, dated 2026-10-12 ✨ mwah πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from