CURLOPT\_APPEND(3) Library Functions Manual CURLOPT\_APPEND(3)

# [NAME](#NAME)

CURLOPT\_APPEND - append to the remote file

# [SYNOPSIS](#SYNOPSIS)

```
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_APPEND, long append);
```

# [DESCRIPTION](#DESCRIPTION)

A long parameter set to 1 tells the library to append to the remote file instead of overwrite it. This is only useful when uploading to an FTP site.

# [DEFAULT](#DEFAULT)

0 (disabled)

# [PROTOCOLS](#PROTOCOLS)

This functionality affects ftp and sftp

# [EXAMPLE](#EXAMPLE)

```
int main(void)
{


  CURL *curl = curl_easy_init();


  if(curl) {


    CURLcode result;


    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/to/newfile");


    curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);


    curl_easy_setopt(curl, CURLOPT_APPEND, 1L);


    result = curl_easy_perform(curl);


    curl_easy_cleanup(curl);


  }
}
```

# [HISTORY](#HISTORY)

This option was known as CURLOPT\_FTPAPPEND up to 7.16.4

# [AVAILABILITY](#AVAILABILITY)

Added in curl 7.17.0

# [RETURN VALUE](#RETURN_VALUE)

[*curl\_easy\_setopt(3)*](/man/os/curl/curl_easy_setopt.3) returns a CURLcode indicating success or error.

CURLE\_OK (0) means everything was OK, non-zero means an error occurred, see [*libcurl-errors(3)*](/man/os/curl/libcurl-errors.3).

# [SEE ALSO](#SEE_ALSO)

[**CURLOPT\_DIRLISTONLY**(3)](/man/os/curl/CURLOPT_DIRLISTONLY.3), [**CURLOPT\_RESUME\_FROM**(3)](/man/os/curl/CURLOPT_RESUME_FROM.3), [**CURLOPT\_UPLOAD**(3)](/man/os/curl/CURLOPT_UPLOAD.3)

2026-10-31 libcurl

---

Document: CURLOPT_APPEND(3) from curl 8.23.0-r3 (Chainguard OS)
Source: https://github.com/curl/curl.git
