1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_TRANSFERTEXT
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_CRLF (3)
9Protocol:
10  - All
11---
12
13# NAME
14
15CURLOPT_TRANSFERTEXT - request a text based transfer for FTP
16
17# SYNOPSIS
18
19~~~c
20#include <curl/curl.h>
21
22CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRANSFERTEXT, long text);
23~~~
24
25# DESCRIPTION
26
27A parameter set to 1 tells the library to use ASCII mode for FTP transfers,
28instead of the default binary transfer. For win32 systems it does not set the
29stdout to binary mode. This option can be usable when transferring text data
30between systems with different views on certain characters, such as newlines
31or similar.
32
33libcurl does not do a complete ASCII conversion when doing ASCII transfers
34over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
35simply sets the mode to ASCII and performs a standard transfer.
36
37# DEFAULT
38
390, disabled
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/textfile");
50    curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
51    res = curl_easy_perform(curl);
52    curl_easy_cleanup(curl);
53  }
54}
55~~~
56
57# AVAILABILITY
58
59Along with FTP
60
61# RETURN VALUE
62
63Returns CURLE_OK if FTP is supported, and CURLE_UNKNOWN_OPTION if not.
64