CURLOPT_RESUME_FROM_LARGE(3)
β¨ CURLOPT_RESUME_FROM_LARGE π
okay so real talk, bestie β this one lives in the Library Functions Manual section of the curl docs, and it's the big-sibling version of the resume option. Let's get into it π«Ά
πΈ NAME πΈ
CURLOPT_RESUME_FROM_LARGE β the offset you wanna resume a transfer from, but make it large π
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESUME_FROM_LARGE,
curl_off_t from);
π¦ DESCRIPTION π¦
So you pass a curl_off_t as the parameter, and it holds the offset β in number of bytes β of where you want the transfer to start. That's it, that's the vibe β¨
Set this option to 0 and the transfer just starts from the beginning again (which effectively disables resume β like, it's so over). π
For FTP though? Set this option to -1 and the transfer starts from the end of the target file. Super useful for continuing an interrupted upload, iykyk π₯
And when you're doing uploads with FTP, the resume position is where in the local/source file libcurl should try to resume the upload from β and it appends the source file to the remote target file. Main character energy, honestly π
π DEFAULT π
0, not used
π PROTOCOLS π
This functionality affects all supported protocols β no gatekeeping here, we love an inclusive icon β
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_off_t resume_position = 1234; /* get it somehow */
curl_off_t file_size = 9876; /* get it somehow as well */
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
/* resuming upload at this position, possibly beyond 2GB */
curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, resume_position);
/* ask for upload */
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* set total data amount to expect */
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_size);
/* Perform the request */
curl_easy_perform(curl);
}
}
like yes, resuming an upload at a position possibly beyond 2GB β that's the whole point of the _LARGE girlies πβ¨
β AVAILABILITY β
Added in curl 7.11.0 β a classic, honestly, she's been iconic for ages π
π§ RETURN VALUE π§
curl_easy_setopt(3) returns a CURLcode indicating success or error, bestie.
CURLE_OK (0) means everything was OK β green flags only π’. Non-zero means an error occurred, and you should go check libcurl-errors(3) to find out what went down π
π SEE ALSO π
that's the whole page, no notes π this beauty ships from libcurl, dated 2026-10-12 β mwah, go resume something big π
π¦ 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