1CURLOPT_FTP_USE_PRET(3)    curl_easy_setopt options    CURLOPT_FTP_USE_PRET(3)
2
3
4

NAME

6       CURLOPT_FTP_USE_PRET - use PRET for FTP
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_PRET, long enable);
12

DESCRIPTION

14       Pass  a  long.  If the value is 1, it tells curl to send a PRET command
15       before PASV (and EPSV). Certain FTP  servers,  mainly  drftpd,  require
16       this  non-standard  command  for  directory  listings as well as up and
17       downloads in PASV mode. Has no effect when using the active FTP  transā€
18       fers mode.
19

DEFAULT

21       0
22

PROTOCOLS

24       FTP
25

EXAMPLE

27       CURL *curl = curl_easy_init();
28       if(curl) {
29         curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt");
30
31         /* a drftpd server, do it! */
32         curl_easy_setopt(curl, CURLOPT_FTP_USE_PRET, 1L);
33
34         ret = curl_easy_perform(curl);
35
36         curl_easy_cleanup(curl);
37       }
38

AVAILABILITY

40       Added in 7.20.0
41

RETURN VALUE

43       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
44       if not.
45

SEE ALSO

47       CURLOPT_FTP_USE_EPRT(3), CURLOPT_FTP_USE_EPSV(3),
48
49
50
51libcurl 7.85.0                   May 17, 2022          CURLOPT_FTP_USE_PRET(3)
Impressum