CURLOPT_FTP_USE_PRET.3 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. .\" generated by cd2nroff 0.1 from CURLOPT_FTP_USE_PRET.md
  2. .TH CURLOPT_FTP_USE_PRET 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_FTP_USE_PRET \- use PRET for FTP
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_PRET, long enable);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a long. If the value is 1, it tells curl to send a PRET command before
  12. PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non\-standard
  13. command for directory listings as well as up and downloads in PASV mode. Has
  14. no effect when using the active FTP transfers mode.
  15. .SH DEFAULT
  16. 0
  17. .SH PROTOCOLS
  18. This functionality affects ftp only
  19. .SH EXAMPLE
  20. .nf
  21. int main(void)
  22. {
  23. CURL *curl = curl_easy_init();
  24. if(curl) {
  25. CURLcode res;
  26. curl_easy_setopt(curl, CURLOPT_URL,
  27. "ftp://example.com/old-server/file.txt");
  28. /* a drftpd server, do it! */
  29. curl_easy_setopt(curl, CURLOPT_FTP_USE_PRET, 1L);
  30. res = curl_easy_perform(curl);
  31. curl_easy_cleanup(curl);
  32. }
  33. }
  34. .fi
  35. .SH AVAILABILITY
  36. Added in curl 7.20.0
  37. .SH RETURN VALUE
  38. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  39. .SH SEE ALSO
  40. .BR CURLOPT_FTP_USE_EPRT (3),
  41. .BR CURLOPT_FTP_USE_EPSV (3)