CURLOPT_FTP_USE_EPSV(3)

πŸ’… CURLOPT_FTP_USE_EPSV(3)

okay so bestie, welcome to the CURLOPT_FTP_USE_EPSV(3) page β€” that's from the Library Functions Manual, and yes it's about FTP, don't scroll away, it's actually cute I promise 🫢


✨ NAME ✨

CURLOPT_FTP_USE_EPSV β€” literally just "use EPSV for FTP" πŸ’«


🌸 SYNOPSIS 🌸

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_EPSV, long epsv);

πŸ¦‹ DESCRIPTION πŸ¦‹

so you pass epsv in as a long, right? and if that value is 1, it tells curl "hey queen, use the EPSV command when doing passive FTP downloads" β€” which, btw, it already does by default, she's an overachiever like that πŸ‘‘

using EPSV means libcurl first attempts to use the EPSV command before using PASV. and if you pass zero to this option? then nope, no EPSV for you, only plain PASV. simple as πŸŽ€

the EPSV command is a slightly newer addition to the FTP protocol than PASV and it's the preferred command to use since it enables IPv6 to be used ✨ iconic behavior truly. but lowkey, old FTP servers might not support it, which is why libcurl has a fallback mechanism. and sometimes that fallback is not enough 😭 and then this option might come handy. iykyk.

heads up bestie: if the server is an IPv6 host, this option has no effect. like, zero. nada. it's doing nothinggg πŸ’€

πŸŽ€ DEFAULT πŸŽ€

1


🌈 PROTOCOLS 🌈

this functionality affects ftp only. that's it. that's the whole list. periodt. πŸ’…


πŸ”₯ EXAMPLE πŸ”₯

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL,
                     "ftp://example.com/old-server/file.txt");

    /* let's shut off this modern feature */
    curl_easy_setopt(curl, CURLOPT_FTP_USE_EPSV, 0L);

    result = curl_easy_perform(curl);

    curl_easy_cleanup(curl);
  }
}

look at that comment β€” "let's shut off this modern feature" β€” the original author was in their era fr fr πŸ™ˆ


⭐ AVAILABILITY ⭐

Added in curl 7.9.2 β€” a certified classic, vintage, main character energy πŸ‘‘


πŸ“ RETURN VALUE πŸ“

curl_easy_setopt(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK πŸ₯³ β€” non-zero means an error occurred 😭, see libcurl-errors(3) for the deets.


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page bestie, no cap πŸ’– this lil' beauty came to you from libcurl, dated 2026-10-12, filed under CURLOPT_FTP_USE_EPSV(3) β€” slay, go configure your FTP, you've got this 🧚✨

πŸ“¦ where this page comes from