---
title: t SFTP
description: Available triggers
documentId: ipaas-sftp-trigger
locale: en-US
---

The [**SFTP**](https://camel.apache.org/components/4.10.x/sftp-component.html) component provides access to remote file systems through FTP and SFTP protocols. 

**URI Syntax**: `sftp:host:port/directoryName`

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `host` (common)         | (required) Hostname of the FTP server.| — | String |
| `port` (common)         | Port of the FTP server.                     | — | int    |
| `directoryName` (common)| Initial directory.                         | — | String |

*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `username` (security) | Username for SFTP server authentication.| — | String |
| `password`(security)  | Password for SFTP server authentication.          | — | String |
| `fileName`(common)    | Used to dynamically set the file name as an expression. In the consumer, it serves as a name filter; in the producer, to evaluate the filename to write. | — | String | 
|`passiveMode` (common) | Defines that the SFTP connection should use passive mode.  |false| boolean |
| `includeExt` (filter) | Used to include files matching the file extension name (case-insensitive). For example, to include `.txt` files, use `includeExt=txt`. Multiple extensions can be separated by commas; for example, to include `.txt` and `.xml` files, use `includeExt=txt,xml`. | — | String |
| `delay` (scheduler) | Milliseconds before the next poll. | 500 | long |

## Example

<Steps>
<Step>
The flow reads `.txt` files from a specified SFTP server every 10 seconds, using a username and password for authentication.
</Step>
<Step>
Then, the content is displayed in a log.
</Step>
</Steps>

```yaml
- from:
    uri: "sftp:demo.wftpserver.com:2222/download"
    parameters:
      username: "demo"
      password: "demo"
      includeExt: "txt"
      delay: 10000
    steps:
      - to:
          uri: "log:responseLogger"
```
<Callout type="note" title="NOTE">
The component does not delete files that have already been processed, as the server operates in read-only mode.
</Callout>

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/sftp_trigger_d3d7f9bd1a.png)

### Result

```
[1] 2024-02-05 13:59:13,071 INFO  [io.quarkus] (main) Installed features: [camel-bean, camel-cloudevents, camel-core, camel-file, camel-ftp, camel-groovy-dsl, camel-k-core, camel-k-runtime, camel-knative, camel-kubernetes, cdi, groovy, jsch, kubernetes-client, smallrye-context-propagation, vertx]
[1] 2024-02-05 13:59:15,606 INFO  [route1] (Camel (camel-1) thread #1 - sftp://demo.wftpserver.com:2222/download) Downloaded File Content
[1] : Wing FTP Server v7.3.0              Released: 2/Jan/2024
[1] --------------------------------------------------------------
[1] Improvement -  Filezilla will get stuck occasionally when uploading files via FTPS/FTPES protocol.
[1] Improvement - Removed SSH cipher "chacha20-poly1305" to avoid SSH Terrapin attacks (CVE-2023-48795).
[1] Improvement - Improved the web client interface for the file listing and search window.
[1] Fixed a bug - Fixed a possible crash when transferring files via FTP protocol.
[1] Fixed a bug - Web client can't remember the selected language in the login page.
[1] 
[1] 
[1] Wing FTP Server v7.2.8              Released: 30/Nov/2023
[1] --------------------------------------------------------------
[1] Improvement -  Added a function "Video Preview" for the weblink download page.
[1] Fixed a bug - Client will always see the file request page, even if the option "Enable file request link" is turned off.
[1] Fixed a bug -  The sockets will increase rapidly when an exception "transport endpoint is not connected" occurs.
[1] Improvement -  When closing a domain under WingFTP's administration, Wing Gateway will update the related listeners immediately.
[1] 
...
(file content truncated)
```

<Callout type="note" title="NOTE">
- The connection configured in the example does not validate the SFTP server's identity, which means it would not detect potential security issues.

- For secure validation, Apache Camel allows using a `known_hosts` file. To do this, you need to:
  1. Include the `known_hosts` file as a **resource** in the integration.
  2. Configure the `knownHostsFile` parameter pointing to the file.
  3. Enable the `strictHostKeyChecking` parameter.

Read more about [Resources](/docs/integrations/ipaas-resources) files.
</Callout>
