CURLOPT_FTP_USE_EPRT.3 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_FTP_USE_EPRT 3 "January 02, 2023" "libcurl 7.88.1" "curl_easy_setopt options"
  26. .SH NAME
  27. CURLOPT_FTP_USE_EPRT \- use EPRT for FTP
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_EPRT, long enabled);
  32. .fi
  33. .SH DESCRIPTION
  34. Pass a long. If the value is 1, it tells curl to use the EPRT command when
  35. doing active FTP downloads (which is enabled by
  36. \fICURLOPT_FTPPORT(3)\fP). Using EPRT means that it will first attempt to use
  37. EPRT before using PORT, but if you pass zero to this option, it will not try
  38. using EPRT, only plain PORT.
  39. If the server is an IPv6 host, this option will have no effect as EPRT is
  40. necessary then.
  41. .SH DEFAULT
  42. .SH PROTOCOLS
  43. .SH EXAMPLE
  44. .nf
  45. CURL *curl = curl_easy_init();
  46. if(curl) {
  47. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
  48. /* contact us back, aka "active" FTP */
  49. curl_easy_setopt(curl, CURLOPT_FTPPORT, "-");
  50. /* FTP the way the neanderthals did it */
  51. curl_easy_setopt(curl, CURLOPT_FTP_USE_EPRT, 0L);
  52. ret = curl_easy_perform(curl);
  53. curl_easy_cleanup(curl);
  54. }
  55. .fi
  56. .SH AVAILABILITY
  57. Added in 7.10.5
  58. .SH RETURN VALUE
  59. Returns CURLE_OK
  60. .SH "SEE ALSO"
  61. .BR CURLOPT_FTP_USE_EPSV "(3), " CURLOPT_FTPPORT "(3), "