1CURLOPT_FTP_USE_PRET(3) curl_easy_setopt options CURLOPT_FTP_USE_PRET(3)
2
3
4
6 CURLOPT_FTP_USE_PRET - use PRET for FTP
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_PRET, long en‐
12 able);
13
15 Pass a long. If the value is 1, it tells curl to send a PRET command
16 before PASV (and EPSV). Certain FTP servers, mainly drftpd, require
17 this non-standard command for directory listings as well as up and
18 downloads in PASV mode. Has no effect when using the active FTP trans‐
19 fers mode.
20
22 0
23
25 FTP
26
28 CURL *curl = curl_easy_init();
29 if(curl) {
30 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt");
31
32 /* a drftpd server, do it! */
33 curl_easy_setopt(curl, CURLOPT_FTP_USE_PRET, 1L);
34
35 ret = curl_easy_perform(curl);
36
37 curl_easy_cleanup(curl);
38 }
39
41 Added in 7.20.0
42
44 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
45 if not.
46
48 CURLOPT_FTP_USE_EPRT(3), CURLOPT_FTP_USE_EPSV(3),
49
50
51
52libcurl 7.79.1 September 08, 2021 CURLOPT_FTP_USE_PRET(3)