1. Home
  2. ...
  3. File Storage and Transfer
  4. c SFTP

c SFTP

Available connectors

The SFTP component provides access to remote file systems through the FTP and SFTP protocols. Operation only in passive mode.

URI syntax: sftp:host:port/directoryName

Main fields

Path parameters

Name
Description
Default
Type
host (common)(required) FTP server hostname.—String
port (common)FTP server port.—int
directoryName (common)Initial directory.—String

Query parameters

Name
Description
Default
Type
username (security)Username for authentication on the SFTP server.—String
password(security)Password for authentication on the SFTP server.—String
fileName(common)Used to dynamically set the file name as an expression. In the consumer, serves as a name filter; in the producer, to evaluate the file name to write.—String
passiveMode (common)Defines that the SFTP connection should use passive mode.falseboolean

Example

The flow is triggered by a Quartz trigger, which fires every minute.

When the flow starts, the message body is set to Hello World.

Next, the flow sends this message as a file named helloworld.txt to an SFTP server at address demo.wftpserver.com, on port 2222, in the /upload directory.

Result

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, it is necessary 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 files.

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more