1CURLOPT_RESUME_FROM(3)     curl_easy_setopt options     CURLOPT_RESUME_FROM(3)
2
3
4

NAME

6       CURLOPT_RESUME_FROM - offset to resume transfer from
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESUME_FROM, long from);
12

DESCRIPTION

14       Pass  a  long  as  parameter. It contains the offset in number of bytes
15       that you want the transfer to start from. Set this option to 0 to  make
16       the  transfer  start from the beginning (effectively disabling resume).
17       For FTP, set this option to -1 to make the transfer start from the  end
18       of the target file (useful to continue an interrupted upload).
19
20       When  doing  uploads  with FTP, the resume position is where in the lo‐
21       cal/source file libcurl should try to resume the  upload  from  and  it
22       will then append the source file to the remote target file.
23
24       If  you need to resume a transfer beyond the 2GB limit, use CURLOPT_RE‐
25       SUME_FROM_LARGE(3) instead.
26

DEFAULT

28       0, not used
29

PROTOCOLS

31       HTTP, FTP, SFTP, FILE
32

EXAMPLE

34       CURL *curl = curl_easy_init();
35       if(curl) {
36         curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
37
38         /* resume upload at byte index 200 */
39         curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 200L);
40
41         /* ask for upload */
42         curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
43
44         /* set total data amount to expect */
45         curl_easy_setopt(curl, CURLOPT_INFILESIZE, size_of_file);
46
47         /* Perform the request */
48         curl_easy_perform(curl);
49       }
50

AVAILABILITY

52       Always
53

RETURN VALUE

55       Returns CURLE_OK
56

SEE ALSO

58       CURLOPT_RESUME_FROM_LARGE(3), CURLOPT_RANGE(3), CURLOPT_INFILESIZE(3),
59
60
61
62libcurl 7.85.0                   May 17, 2022           CURLOPT_RESUME_FROM(3)
Impressum