1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_RESUME_FROM_LARGE 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_INFILESIZE_LARGE (3) 9 - CURLOPT_RANGE (3) 10 - CURLOPT_RESUME_FROM (3) 11Protocol: 12 - All 13--- 14 15# NAME 16 17CURLOPT_RESUME_FROM_LARGE - offset to resume transfer from 18 19# SYNOPSIS 20 21~~~c 22#include <curl/curl.h> 23 24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESUME_FROM_LARGE, 25 curl_off_t from); 26~~~ 27 28# DESCRIPTION 29 30Pass a curl_off_t as parameter. It contains the offset in number of bytes that 31you want the transfer to start from. Set this option to 0 to make the transfer 32start from the beginning (effectively disabling resume). For FTP, set this 33option to -1 to make the transfer start from the end of the target file 34(useful to continue an interrupted upload). 35 36When doing uploads with FTP, the resume position is where in the local/source 37file libcurl should try to resume the upload from and it appends the source 38file to the remote target file. 39 40# DEFAULT 41 420, not used 43 44# EXAMPLE 45 46~~~c 47int main(void) 48{ 49 CURL *curl = curl_easy_init(); 50 if(curl) { 51 curl_off_t resume_position; /* get it somehow */ 52 curl_off_t file_size; /* get it somehow as well */ 53 54 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com"); 55 56 /* resuming upload at this position, possibly beyond 2GB */ 57 curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, resume_position); 58 59 /* ask for upload */ 60 curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); 61 62 /* set total data amount to expect */ 63 curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_size); 64 65 /* Perform the request */ 66 curl_easy_perform(curl); 67 } 68} 69~~~ 70 71# AVAILABILITY 72 73Added in 7.11.0 74 75# RETURN VALUE 76 77Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. 78