1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_PROXY_TRANSFER_MODE 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_CRLF (3) 9 - CURLOPT_HTTPPROXYTUNNEL (3) 10 - CURLOPT_PROXY (3) 11 - CURLOPT_TRANSFERTEXT (3) 12Protocol: 13 - All 14--- 15 16# NAME 17 18CURLOPT_PROXY_TRANSFER_MODE - append FTP transfer mode to URL for proxy 19 20# SYNOPSIS 21 22~~~c 23#include <curl/curl.h> 24 25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TRANSFER_MODE, 26 long enabled); 27~~~ 28 29# DESCRIPTION 30 31Pass a long. If the value is set to 1 (one), it tells libcurl to set the 32transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by 33appending ;type=a or ;type=i to the URL. Without this setting, or it being set 34to 0 (zero, the default), CURLOPT_TRANSFERTEXT(3) has no effect when 35doing FTP via a proxy. Beware that not all proxies support this feature. 36 37# DEFAULT 38 390, disabled 40 41# EXAMPLE 42 43~~~c 44int main(void) 45{ 46 CURL *curl = curl_easy_init(); 47 if(curl) { 48 CURLcode res; 49 curl_easy_setopt(curl, CURLOPT_URL, 50 "ftp://example.com/old-server/file.txt"); 51 curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:80"); 52 curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L); 53 curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L); 54 res = curl_easy_perform(curl); 55 curl_easy_cleanup(curl); 56 } 57} 58~~~ 59 60# AVAILABILITY 61 62Added in 7.18.0 63 64# RETURN VALUE 65 66Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if the 67enabled value is not supported. 68