GNURLINFO...H_UPLOAD_T(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

Okay bestie, welcome to the GNURLINFO...H_UPLOAD_T(3) page from the curl_easy_getinfo options manual β€” and it's all about CURLINFO_CONTENT_LENGTH_UPLOAD_T, which gets the specified size of the upload. πŸ’…βœ¨


✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle,
CURLINFO_CONTENT_LENGTH_UPLOAD_T,
                           curl_off_t *content_length);

πŸŽ€ DESCRIPTION πŸŽ€

Pass a pointer to a curl_off_t to receive the specified size of the upload. It stores -1 if the size isn't known. No cap, that's the whole vibe. 🫢


🌈 PROTOCOLS 🌈

All β€” every protocol, no gatekeeping. πŸ’–


πŸ¦‹ EXAMPLE πŸ¦‹

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");

  /* Perform the upload */
  res = curl_easy_perform(curl);

  if(!res) {
    /* check the size */
    curl_off_t cl;
    res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_UPLOAD_T, &cl);
    if(!res) {
      printf("Upload size: %" CURL_FORMAT_CURL_OFF_T "\n", cl);
    }
  }
}

⭐ AVAILABILITY ⭐

Added in 7.55.0 β€” she's been iconic for a minute. πŸ‘‘


πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple, clean, slay. ✨


🌸 SEE ALSO 🌸


This iconic page is brought to you by libcurl 7.55.0 and 25 May 2017 β€” GNURLINFO...H_UPLOAD_T(3) out, bestie πŸ’…πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from