CURLOPT_TRANSFERTEXT.3 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .\" generated by cd2nroff 0.1 from CURLOPT_TRANSFERTEXT.md
  2. .TH CURLOPT_TRANSFERTEXT 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_TRANSFERTEXT \- request a text based transfer for FTP
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRANSFERTEXT, long text);
  9. .fi
  10. .SH DESCRIPTION
  11. A parameter set to 1 tells the library to use ASCII mode for FTP transfers,
  12. instead of the default binary transfer. For win32 systems it does not set the
  13. stdout to binary mode. This option can be usable when transferring text data
  14. between systems with different views on certain characters, such as newlines
  15. or similar.
  16. libcurl does not do a complete ASCII conversion when doing ASCII transfers
  17. over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
  18. simply sets the mode to ASCII and performs a standard transfer.
  19. .SH DEFAULT
  20. 0, disabled
  21. .SH PROTOCOLS
  22. This functionality affects all supported protocols
  23. .SH EXAMPLE
  24. .nf
  25. int main(void)
  26. {
  27. CURL *curl = curl_easy_init();
  28. if(curl) {
  29. CURLcode res;
  30. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/textfile");
  31. curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
  32. res = curl_easy_perform(curl);
  33. curl_easy_cleanup(curl);
  34. }
  35. }
  36. .fi
  37. .SH AVAILABILITY
  38. Added in curl 7.1.1
  39. .SH RETURN VALUE
  40. Returns CURLE_OK if FTP is supported, and CURLE_UNKNOWN_OPTION if not.
  41. .SH SEE ALSO
  42. .BR CURLOPT_CRLF (3)