CURLOPT_INFILESIZE_LARGE(3)
π CURLOPT_INFILESIZE_LARGE(3) β like, the libcurl manual, bestie edition π
okay so real talk: this is a page from the Library Functions Manual, and today we're learning CURLOPT_INFILESIZE_LARGE β the glow-up sibling of the regular infilesize option, but for when your file is big big. Let's get into it β¨
πΈ NAME πΈ
CURLOPT_INFILESIZE_LARGE β telling libcurl how big your input file is before you send it off. like a vibe check for your upload, but with bytes π
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_INFILESIZE_LARGE,
curl_off_t filesize);
that's it, that's the whole mood π
π DESCRIPTION π
so when you're uploading a file to some remote site, you use filesize to tell libcurl what the expected size of the input file is. and bestie, this value has to be passed as a curl_off_t β no shortcuts, no "close enough" types, it's giving specific π
btw if you're uploading using SCP, this option or CURLOPT_INFILESIZE(3) is mandatory β like, not optional, not "maybe later", mandatory mandatory. main character requirement fr fr π
want to unset this value again? just set it to -1. that's the undo button, no cap π
and oh! when you're sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. cute little bonus feature π
ok here's the important caveat, listen up π₯: this option does not limit how much data libcurl actually sends. that's controlled entirely by what the read callback returns β periodt. so if you tell it one value and then send a different amount, you may get errors. telling lies to libcurl = consequences, iykyk π
β DEFAULT β
Unset β literally no value, it's a blank canvas, an empty group chat π
π PROTOCOLS π
This functionality affects all supported protocols. every single one. universal slay π«Ά
π EXAMPLE π
ok here's a whole little program, isn't she precious:
#define FILE_SIZE 123456
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_off_t uploadsize = FILE_SIZE;
curl_easy_setopt(curl, CURLOPT_URL,
"ftp://example.com/destination.tar.gz");
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, uploadsize);
curl_easy_perform(curl);
}
}
see how she sets the URL, turns on CURLOPT_UPLOAD with 1L, then drops in the big file size? that's the whole flow, ate and left no crumbs π₯
π§ HISTORY π§
SMTP support was added in 7.23.0 β a lil throwback moment for the email girlies π
π AVAILABILITY π
Added in curl 7.11.0. she's been iconic for a minute β
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK(0) means everything was OK β like, we're so back π- non-zero means an error occurred β check
libcurl-errors(3)for the full tea π
π SEE ALSO π
go read those too, they're all connected bestie, it's a whole ecosystem π¦
okay that's the page!! this was libcurl, dated 2026-10-12, and the page is CURLOPT_INFILESIZE_LARGE(3) β go forth and upload responsibly, mwah πβ¨πΈ
π¦ 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