GNURLOPT_P...NSFER_MODE(3)
π GNURLOPT_P...NSFER_MODE(3) π
okay so this is one of the curl_easy_setopt options, bestie β literally straight out of the gnurl/curl manual, and we're gonna get you fluent in it β¨
πΈ NAME πΈ
CURLOPT_PROXY_TRANSFER_MODE β it appends the FTP transfer mode to the URL when you're going through a proxy π«Ά
π SYNOPSIS π
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TRANSFER_MODE,
long enabled);
β¨ DESCRIPTION β¨
So you pass a long, right? And if that value is set to 1 (one), it tells libcurl to set the transfer mode β that's binary or ASCII β for FTP transfers done via an HTTP proxy, by appending ;type=a or ;type=i to the URL. no cap, that's the whole bit π₯
Without this setting β or if it's set to 0 (zero, which is the default btw) β CURLOPT_TRANSFERTEXT(3) has no effect when you're doing FTP via a proxy. Like, zero, nada, the setting just sits there looking cute π
β οΈ beware bestie: not all proxies support this feature. it's giving "your mileage may vary" and we do not want you blaming curl for that π
π DEFAULT π
0, disabled β it's off until you say otherwise π
π¦ PROTOCOLS π¦
FTP over proxy π
β EXAMPLE β
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt");
curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:80");
curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
look at her go π set the URL, set the proxy, flip the transfer mode on, flip transfertext on, and then actually perform it. order matters, iykyk π
π AVAILABILITY π
Added in 7.18.0 β vintage but iconic β¨
π§ RETURN VALUE π§
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if the enabled value is not supported π
π SEE ALSO π
k that's the whole page, mwah π«Ά β this one's from libcurl 7.37.0, dated 19 Jun 2014, and the page header lives at GNURLOPT_P...NSFER_MODE(3). go forth and proxy responsibly, bestie ππ
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms