CURLOPT_PROXY_TRANSFER_MODE.3 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_TRANSFER_MODE.md
  2. .TH CURLOPT_PROXY_TRANSFER_MODE 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_TRANSFER_MODE \- append FTP transfer mode to URL for proxy
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TRANSFER_MODE,
  9. long enabled);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a long. If the value is set to 1 (one), it tells libcurl to set the
  13. transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by
  14. appending ;type=a or ;type=i to the URL. Without this setting, or it being set
  15. to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT(3)\fP has no effect when
  16. doing FTP via a proxy. Beware that not all proxies support this feature.
  17. .SH DEFAULT
  18. 0, disabled
  19. .SH PROTOCOLS
  20. This functionality affects all supported protocols
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. CURL *curl = curl_easy_init();
  26. if(curl) {
  27. CURLcode res;
  28. curl_easy_setopt(curl, CURLOPT_URL,
  29. "ftp://example.com/old-server/file.txt");
  30. curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:80");
  31. curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
  32. curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
  33. res = curl_easy_perform(curl);
  34. curl_easy_cleanup(curl);
  35. }
  36. }
  37. .fi
  38. .SH AVAILABILITY
  39. Added in curl 7.18.0
  40. .SH RETURN VALUE
  41. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if the
  42. enabled value is not supported.
  43. .SH SEE ALSO
  44. .BR CURLOPT_CRLF (3),
  45. .BR CURLOPT_HTTPPROXYTUNNEL (3),
  46. .BR CURLOPT_PROXY (3),
  47. .BR CURLOPT_TRANSFERTEXT (3)