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