diff options
Diffstat (limited to 'docs/libcurl/opts/CURLOPT_RESUME_FROM.3')
-rw-r--r-- | docs/libcurl/opts/CURLOPT_RESUME_FROM.3 | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/docs/libcurl/opts/CURLOPT_RESUME_FROM.3 b/docs/libcurl/opts/CURLOPT_RESUME_FROM.3 index c61fd3b65..c25c6466b 100644 --- a/docs/libcurl/opts/CURLOPT_RESUME_FROM.3 +++ b/docs/libcurl/opts/CURLOPT_RESUME_FROM.3 @@ -45,10 +45,28 @@ If you need to resume a transfer beyond the 2GB limit, use .SH PROTOCOLS HTTP, FTP, SFTP, FILE .SH EXAMPLE -TODO +.nf +CURL *curl = curl_easy_init(); +if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com"); + + /* resume upload at byte index 200 */ + curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 200L); + + /* ask for upload */ + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); + + /* set total data amount to expect */ + curl_easy_setopt(curl, CURLOPT_INFILESIZE, size_of_file); + + /* Perform the request */ + curl_easy_perform(curl); +} +.fi .SH AVAILABILITY Always .SH RETURN VALUE Returns CURLE_OK .SH "SEE ALSO" .BR CURLOPT_RESUME_FROM_LARGE "(3), " CURLOPT_RANGE "(3), " +.BR CURLOPT_INFILESIZE "(3), " |