# SFTP (Legacy)

{% hint style="info" %}
This reference documentation is for the **Legacy** SFTP book.
{% endhint %}

## Prerequisites

In order to use the Legacy SFTP book, you need to first add it to your agent.

### Adding the Book

1. Navigate to **Books → All Books**.
2. Click **SFTP Client&#x20;*****(Legacy)*****.**
3. Click on **Add Connection**.
4. Enter your credentials when prompted:
   1. Username
   2. Password
   3. Host
   4. Port

## Automation Procedures

### Downloading Files

To download a file using SFTP, use the following syntax:

```
connect to sftp with
    the host is "sftp.example.com"
    the port is 22
    the username is "user"
    the password is "password"
get a file from sftp with
    the remote path is "/path/to/remote/file.txt"
```

### Uploading Files

#### Basic Upload

To upload a file to an SFTP server, use the following syntax:

```
connect to sftp with
    the host is "sftp.example.com"
    the username is "user"
    the password is "password"
get the file
dump the file to sftp
```

#### Upload with Specified Remote Path <a href="#upload-with-specified-remote-path" id="upload-with-specified-remote-path"></a>

To upload a file to a specific path on the SFTP server, use the following syntax:

```
connect to sftp with
    the host is "sftp.example.com"
    the username is "user"
    the password is "password"
get the file
the remote path is "/uploads/myfile.txt"
dump the file to sftp
```

In this example, the file is uploaded to the specified remote path.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kognitos.com/legacy/legacy-experience/books/reference/sftp-legacy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
