GNURLOPT_RESUME_FROM(3)
π GNURLOPT_RESUME_FROM(3) β curl_easy_setopt options π
okay bestie so this is a page from the curl_easy_setopt options manual, and it's literally all about picking the exact byte where your transfer starts. it's giving "skip to the good part" energy β¨
β¨ NAME β¨
CURLOPT_RESUME_FROM β set a point to resume transfer from π«Ά
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESUME_FROM, long from);
π¦ DESCRIPTION π¦
okay so you pass a long as the parameter, and it holds the offset β in number of bytes β that you want the transfer to start from. that's it, that's the whole vibe π
set this option to 0 and your transfer starts from the very beginning (which, lowkey, just means resume is effectively turned off). for FTP though? set it to -1 and the transfer starts from the end of the target file β super handy when you wanna continue an interrupted upload π
and when you're doing uploads with FTP, the resume position is where in the local/source file libcurl should try to pick the upload back up from β and then it'll append the source file to the remote target file. no cap. π₯
heads up bestie: if you need to resume a transfer beyond the 2GB limit, use CURLOPT_RESUME_FROM_LARGE(3) instead. the regular one just can't hold that much, iykyk π
π DEFAULT π
0, not used
π PROTOCOLS π
HTTP, FTP, SFTP, FILE
β EXAMPLE β
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
/* resume upload at byte index 200 */
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 200L);
/* ask for upload */
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* set total data amount to expect */
curl_easy_setopt(curl, CURLOPT_INFILESIZE, size_of_file);
/* Perform the request */
curl_easy_perform(curl);
}
like, look at her go π§ she's resuming at byte index 200 and asking for an upload and setting the total data amount to expect β main character energy fr fr π
π AVAILABILITY π
Always β¨ (yes, always. she's been here the whole time.)
π RETURN VALUE π
Returns CURLE_OK π«Ά
π₯ SEE ALSO π₯
aaaand that's the page, bestie π
this was libcurl 7.37.0, dated 17 Jun 2014 β go forth and resume slayfully πΈππ¦
π¦ 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