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