xref: /curl/docs/libcurl/opts/CURLOPT_APPEND.md (revision 5a488251)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.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)
11Protocol:
12  - FTP
13Added-in: 7.17.0
14---
15
16# NAME
17
18CURLOPT_APPEND - append to the remote file
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_APPEND, long append);
26~~~
27
28# DESCRIPTION
29
30A long parameter set to 1 tells the library to append to the remote file
31instead of overwrite it. This is only useful when uploading to an FTP site.
32
33# DEFAULT
34
350 (disabled)
36
37# %PROTOCOLS%
38
39# EXAMPLE
40
41~~~c
42int main(void)
43{
44  CURL *curl = curl_easy_init();
45  if(curl) {
46
47    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/to/newfile");
48    curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
49    curl_easy_setopt(curl, CURLOPT_APPEND, 1L);
50
51    curl_easy_perform(curl);
52  }
53}
54~~~
55
56# HISTORY
57
58This option was known as CURLOPT_FTPAPPEND up to 7.16.4
59
60# %AVAILABILITY%
61
62# RETURN VALUE
63
64Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
65