# FTP/SFTP

Move files to and from a server over SFTP, FTPS or FTP.

## Connect FTP/SFTP

1. In the sidebar, open **Connections** and press **Add connection**.
2. Type `sftp` and choose **FTP/SFTP**.
3. Fill in the fields. Each one says **Required** or **Optional**.
4. Press **Test and save**. GoRunner checks the connection before it saves anything.

The sheet asks for **Protocol**, **Server**, **Port**, **Username**, **Password**, **Private key** and **Accept an unverified TLS certificate**.

[Connections](https://docs.gorunner.io/build/connections) says how to sign in again, rename or delete it. In a product that embeds GoRunner, **Add connection** can be missing: then [your provider makes connections](https://docs.gorunner.io/embed/customer-connections) for you.

## Start a workflow

Add a trigger and choose **FTP/SFTP**. The trigger uses the same connection as the steps.

### New or modified file

Polls a folder and fires once per file that appears or changes, once the file has stopped changing (about a minute after it lands).

- **Folder · Optional**: Leave blank for the directory the login lands in. Only this folder is watched, not the folders inside it.
- **Ignore hidden files · Optional**: Skip names starting with a dot. On by default: many servers write a dotfile while an upload is still in progress.

## Do things in FTP/SFTP

Add an **FTP/SFTP** step and choose an **Operation**. Choose the row to see the fields of each.

- [FTP/SFTP](https://docs.gorunner.io/apps/ftp-sftp#fields-f-sftp): List a folder · Download a file · Upload a file · Create a file from text · Delete a file · Create a folder · Delete a folder · Rename or move

Later steps read a step’s output by its name: see [Use data from earlier steps](https://docs.gorunner.io/build/use-data-from-earlier-steps).

## Limits

- A download is at most 64 MB. A larger file fails the step.
- GoRunner Cloud reaches servers on the public internet only. On a self-hosted installation, an admin can allow private addresses with `WORKFLOW_PRIVATE_NETWORKS`.

Not in your list? See [When an app isn’t here](https://docs.gorunner.io/apps/when-an-app-isnt-here#q-not-in-list).

## For developers

In the API, which calls apps pieces, FTP/SFTP is `pieceId: "sftp"` with `actionId: "sftp"`, set by `operation`. Its trigger is `sftptrigger` / `new_or_modified_file`. [Get an app](https://docs.gorunner.io/api/apps/get-app) returns every field.

It can change something outside the run (`writes_external`). See [How versions and side effects work](https://docs.gorunner.io/apps#q-versions).

### FTP/SFTP › FTP/SFTP

List, download, upload, move or delete files on a remote file server.

### List a folder

- **Folder · Optional**: Leave blank for the directory the login lands in.

### Download a file, Delete a file and Create a folder

- **Path · Required**: The file or folder to act on. Relative paths are resolved from where the login lands.

### Upload a file

- **Path · Required**: The file or folder to act on. Relative paths are resolved from where the login lands.
- **File · Required**: Upload a file, or switch to an expression to use one from an earlier step (such as {{steps.download.result}}). The file to upload.

### Create a file from text

- **Path · Required**: The file or folder to act on. Relative paths are resolved from where the login lands.
- **Content · Required**: The text to write.

### Delete a folder

- **Path · Required**: The file or folder to act on. Relative paths are resolved from where the login lands.
- **Delete everything inside it · Optional**: Off, a folder with anything in it is left alone. Off by default.

### Rename or move

- **Path · Required**: The file or folder to act on. Relative paths are resolved from where the login lands.
- **New path · Required**: Where it ends up. A different folder moves the file.

Source: https://docs.gorunner.io/apps/ftp-sftp
