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

NAME

6       CURLOPT_FTP_USE_PRET - enable the PRET command
7

SYNOPSIS

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

DESCRIPTION

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

DEFAULT

22       0
23

PROTOCOLS

25       FTP
26

EXAMPLE

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

AVAILABILITY

41       Added in 7.20.0
42

RETURN VALUE

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

SEE ALSO

48       CURLOPT_FTP_USE_EPRT(3), CURLOPT_FTP_USE_EPSV(3),
49
50
51
52libcurl 7.76.1                 November 04, 2020       CURLOPT_FTP_USE_PRET(3)
Impressum