GNURLOPT_INFILESIZE(3)
GNURLOPT_INFILESIZE(3) π
okay bestie, welcome to the GNURLOPT_INFILESIZE(3) page from the curl_easy_setopt options manual β gnurl edition, group-chat style. this is all about telling libcurl how big ur upload is gonna be π«Άβ¨
π NAME π
CURLOPT_INFILESIZE β set size of the input file to send off π
π SYNOPSIS π
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_INFILESIZE, long
filesize);
π¦ DESCRIPTION π¦
okay so when ur uploading a file to a remote site, filesize should be used to tell libcurl what the expected size of the input file is. it must be passed as a long, no cap. if ur file is bigger than 2GB, see CURLOPT_INFILESIZE_LARGE(3) β she's the one for the big girlie files π
for uploading using SCP, this option or CURLOPT_INFILESIZE_LARGE(3) is mandatory β like, u literally need one of them, bestie.
wanna unset this value again? set it to -1. periodt.
when sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command π§β¨
vibe check / important caveat: this option does not limit how much data libcurl will actually send, because that is controlled entirely by what the read callback returns. but telling one value and sending a different amount may lead to errors π
π DEFAULT π
Unset β she's just unset π
π PROTOCOLS π
Many β¨
π» EXAMPLE π»
CURL *curl = curl_easy_init();
if(curl) {
long 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, uploadsize);
curl_easy_perform(curl);
}
β AVAILABILITY β
SMTP support added in 7.23.0 π
π₯ RETURN VALUE π₯
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. that's the tea β
π SEE ALSO π
π xoxo, this page is fromlibcurl 7.37.0, dated17 Jun 2014, and it's theGNURLOPT_INFILESIZE(3)manual signing off β mwah π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms