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