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