1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_APPEND
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_DIRLISTONLY (3)
9  - CURLOPT_RESUME_FROM (3)
10  - CURLOPT_UPLOAD (3)
11---
12
13# NAME
14
15CURLOPT_APPEND - append to the remote file
16
17# SYNOPSIS
18
19~~~c
20#include <curl/curl.h>
21
22CURLcode curl_easy_setopt(CURL *handle, CURLOPT_APPEND, long append);
23~~~
24
25# DESCRIPTION
26
27A long parameter set to 1 tells the library to append to the remote file
28instead of overwrite it. This is only useful when uploading to an FTP site.
29
30# DEFAULT
31
320 (disabled)
33
34# PROTOCOLS
35
36FTP
37
38# EXAMPLE
39
40~~~c
41int main(void)
42{
43  CURL *curl = curl_easy_init();
44  if(curl) {
45
46    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/to/newfile");
47    curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
48    curl_easy_setopt(curl, CURLOPT_APPEND, 1L);
49
50    curl_easy_perform(curl);
51  }
52}
53~~~
54
55# AVAILABILITY
56
57This option was known as CURLOPT_FTPAPPEND up to 7.16.4
58
59# RETURN VALUE
60
61Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
62