CURLOPT_FTP_ACCOUNT.md (1395B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_FTP_ACCOUNT 5 Section: 3 6 Source: libcurl 7 Protocol: 8 - FTP 9 See-also: 10 - CURLOPT_PASSWORD (3) 11 - CURLOPT_USERNAME (3) 12 Added-in: 7.13.0 13 --- 14 15 # NAME 16 17 CURLOPT_FTP_ACCOUNT - account info for FTP 18 19 # SYNOPSIS 20 21 ~~~c 22 #include <curl/curl.h> 23 24 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_ACCOUNT, char *account); 25 ~~~ 26 27 # DESCRIPTION 28 29 Pass a pointer to a null-terminated string (or NULL to disable). When an FTP 30 server asks for "account data" after username and password has been provided, 31 this data is sent off using the ACCT command. 32 33 The application does not have to keep the string around after setting this 34 option. 35 36 Using this option multiple times makes the last set string override the 37 previous ones. Set it to NULL to disable its use again. 38 39 # DEFAULT 40 41 NULL 42 43 # %PROTOCOLS% 44 45 # EXAMPLE 46 47 ~~~c 48 int 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 68 curl_easy_setopt(3) returns a CURLcode indicating success or error. 69 70 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 71 libcurl-errors(3).