CURLOPT_RESUME_FROM_LARGE.3 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .\" generated by cd2nroff 0.1 from CURLOPT_RESUME_FROM_LARGE.md
  2. .TH CURLOPT_RESUME_FROM_LARGE 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_RESUME_FROM_LARGE \- offset to resume transfer from
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESUME_FROM_LARGE,
  9. curl_off_t from);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a curl_off_t as parameter. It contains the offset in number of bytes that
  13. you want the transfer to start from. Set this option to 0 to make the transfer
  14. start from the beginning (effectively disabling resume). For FTP, set this
  15. option to \-1 to make the transfer start from the end of the target file
  16. (useful to continue an interrupted upload).
  17. When doing uploads with FTP, the resume position is where in the local/source
  18. file libcurl should try to resume the upload from and it appends the source
  19. file to the remote target file.
  20. .SH DEFAULT
  21. 0, not used
  22. .SH PROTOCOLS
  23. This functionality affects all supported protocols
  24. .SH EXAMPLE
  25. .nf
  26. int main(void)
  27. {
  28. CURL *curl = curl_easy_init();
  29. if(curl) {
  30. curl_off_t resume_position; /* get it somehow */
  31. curl_off_t file_size; /* get it somehow as well */
  32. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
  33. /* resuming upload at this position, possibly beyond 2GB */
  34. curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, resume_position);
  35. /* ask for upload */
  36. curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
  37. /* set total data amount to expect */
  38. curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_size);
  39. /* Perform the request */
  40. curl_easy_perform(curl);
  41. }
  42. }
  43. .fi
  44. .SH AVAILABILITY
  45. Added in curl 7.11.0
  46. .SH RETURN VALUE
  47. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  48. .SH SEE ALSO
  49. .BR CURLOPT_INFILESIZE_LARGE (3),
  50. .BR CURLOPT_RANGE (3),
  51. .BR CURLOPT_RESUME_FROM (3)