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