1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_FTP_ACCOUNT
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PASSWORD (3)
9  - CURLOPT_USERNAME (3)
10---
11
12# NAME
13
14CURLOPT_FTP_ACCOUNT - account info for FTP
15
16# SYNOPSIS
17
18~~~c
19#include <curl/curl.h>
20
21CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_ACCOUNT, char *account);
22~~~
23
24# DESCRIPTION
25
26Pass a pointer to a null-terminated string (or NULL to disable). When an FTP
27server asks for "account data" after user name and password has been provided,
28this data is sent off using the ACCT command.
29
30The application does not have to keep the string around after setting this
31option.
32
33# DEFAULT
34
35NULL
36
37# PROTOCOLS
38
39FTP
40
41# EXAMPLE
42
43~~~c
44int main(void)
45{
46  CURL *curl = curl_easy_init();
47  if(curl) {
48    CURLcode res;
49    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");
50
51    curl_easy_setopt(curl, CURLOPT_FTP_ACCOUNT, "human-resources");
52
53    res = curl_easy_perform(curl);
54
55    curl_easy_cleanup(curl);
56  }
57}
58~~~
59
60# AVAILABILITY
61
62Added in 7.13.0
63
64# RETURN VALUE
65
66Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
67CURLE_OUT_OF_MEMORY if there was insufficient heap space.
68