Connect to ftp
Function: Connect to FTP
This function allows your application to establish a secure connection with a remote file transfer server, such as an SFTP (Secure File Transfer Protocol) or FTPS (FTP Secure) server. This is a crucial first step for any task that involves interacting with files on an external system, like uploading documents, downloading reports, or synchronizing data. Once connected, you can use other actions to manage files and folders on that server.
Input
- Protocol: Choose the secure file transfer protocol you want to use.
- Type: Selection (SFTP, FTPS)
- Default: SFTP
- Required: Yes
- Authentication: Select how you will prove your identity to the remote server.
- Type: Selection (Use a username & password to authenticate, Use a public & private key to authenticate)
- Default: Use a username & password to authenticate
- Required: Yes
- Username: The username required to log in to the remote server.
- Type: Text
- Required: Yes
- Password: The password associated with your username, used for authentication. This is only needed if you selected "Use a username & password to authenticate".
- Type: Password
- Required: Conditionally (Yes, if Username & Password authentication is chosen)
- Private key: The private key content (usually a long string of characters) used for authentication. This is only needed if you selected "Use a public & private key to authenticate".
- Type: Password
- Required: Conditionally (Yes, if Public & Private Key authentication is chosen)
- Remote host: The address or hostname of the remote server you want to connect to (e.g.,
ftp.example.com).- Type: Text
- Required: Yes
- Port: The specific port number on the remote host to connect through.
- Type: Number
- Default: 22
- Required: No
- Remote directory: An optional starting directory on the remote server. If left empty, you will connect to the root directory.
- Type: Text
- Default: (empty)
- Required: No
Output
- Folder to read: A reference to the connected remote folder. This output can be used by subsequent actions to perform operations like listing files, uploading, or downloading.
- Type: Folder
- Default Variable Name:
FTP_FOLDER
- The status: Indicates whether the connection attempt was successful or if an error occurred.
- Type: Status
- Default Variable Name:
FTP_STATUS
Execution Flow
Real-Life Examples
Example 1: Connect to a Partner's SFTP to Download Reports
Imagine you need to regularly download sales reports from a partner's SFTP server using a username and password.
- Inputs:
- Protocol:
SFTP - Authentication:
Use a username & password to authenticate - Username:
partner_reports - Password:
MySecureP@ssw0rd123 - Remote host:
sftp.partnercompany.com - Port:
22(default, can be left empty) - Remote directory:
/sales/daily_reports
- Protocol:
- Result: The application successfully connects to
sftp.partnercompany.comat the/sales/daily_reportsfolder. TheFTP_FOLDERvariable now holds a reference to this remote folder, andFTP_STATUSis set toSUCCESS. You can now use other actions to list or download files from this folder.
Example 2: Connect to an FTPS Server for Secure File Uploads
Your bank requires you to upload payment files to their FTPS server using a specific username and password.
- Inputs:
- Protocol:
FTPS - Authentication:
Use a username & password to authenticate - Username:
bank_uploader - Password:
BankUpload!2024 - Remote host:
ftps.mybank.com - Port:
990 - Remote directory:
/payments/outgoing
- Protocol:
- Result: The application establishes a secure FTPS connection to
ftps.mybank.comin the/payments/outgoingdirectory. TheFTP_FOLDERvariable is populated with the connected folder, andFTP_STATUSisSUCCESS. You can then proceed to upload your payment files.
Example 3: Automated Data Sync with an Internal Server using a Private Key
You have an automated process that synchronizes data with an internal server using SFTP and a private key for enhanced security.
- Inputs:
- Protocol:
SFTP - Authentication:
Use a public & private key to authenticate - Username:
sync_user - Password: (leave empty, as private key is used)
- Private key:
-----BEGIN RSA PRIVATE KEY-----\n... \(your base64 encoded private key content\) ...\n-----END RSA PRIVATE KEY----- - Remote host:
data-sync.internal.network - Port: (leave empty, uses default 22)
- Remote directory:
/data/sync_point
- Protocol:
- Result: The application connects to
data-sync.internal.networkusing the provided private key, accessing the/data/sync_pointfolder. TheFTP_FOLDERvariable now points to this location, andFTP_STATUSisSUCCESS, allowing the automated data synchronization to proceed.