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

NAME

6       CURLOPT_RESUME_FROM - set a point to resume transfer from
7

SYNOPSIS

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

DESCRIPTION

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

DEFAULT

29       0, not used
30

PROTOCOLS

32       HTTP, FTP, SFTP, FILE
33

EXAMPLE

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

AVAILABILITY

53       Always
54

RETURN VALUE

56       Returns CURLE_OK
57

SEE ALSO

59       CURLOPT_RESUME_FROM_LARGE(3), CURLOPT_RANGE(3), CURLOPT_INFILESIZE(3),
60
61
62
63libcurl 7.76.1                 November 04, 2020        CURLOPT_RESUME_FROM(3)
Impressum