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