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