aboutsummaryrefslogtreecommitdiff
path: root/docs/libcurl/opts/CURLOPT_RESUME_FROM.3
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-10-21 13:40:38 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-10-21 13:40:38 +0200
commit4cb7aa067cb3fb01601dd5d164be8cefe6042211 (patch)
tree259d3d545060b10d6f0bc0da7c20bd3d4c84a2df /docs/libcurl/opts/CURLOPT_RESUME_FROM.3
parent411103251130767daab1b0d966a674b6b822707e (diff)
opts: provide more and updated examples
Diffstat (limited to 'docs/libcurl/opts/CURLOPT_RESUME_FROM.3')
-rw-r--r--docs/libcurl/opts/CURLOPT_RESUME_FROM.320
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), "