Upload File
Overview
The Upload File Component enables users to upload files to a remote FTP or SFTP server. It ensures seamless file transfer for automated workflows requiring remote storage management.
Usage
This component connects to an FTP/SFTP server and uploads a specified file to a given path.
Properties
fileId
string
The unique identifier of the file to upload.
path
string
The full path where the file should be stored, including the filename. If a file already exists at the path, it will be overwritten.
Input Ports
in
Accepts the file ID and target path for upload.
Output Ports
out
Emits the uploaded file’s ID upon successful transfer.
error
Emits an error if the upload fails due to invalid paths, missing files, or permission issues.
Processing Logic
Establishes FTP/SFTP Connection: Securely connects to the remote server using provided authentication credentials.
Reads the Input File:
Retrieves the file stream from the provided
fileId
.
Uploads the File:
Transfers the file to the specified
path
.If a file with the same name exists, it is overwritten.
Handles Success & Errors:
If successful, sends the uploaded file’s
fileId
to theout
port.If an error occurs (e.g., path is an existing directory or lacks permissions), emits a descriptive error to the
error
port.
Closes Connection: Ensures the FTP/SFTP session is properly terminated.
Output Data Schema
fileId
string
The unique identifier of the uploaded file.
errorCode
(if error)
string
FTP/SFTP error code.
errorMessage
(if error)
string
Description of the error encountered.
Notes
Supports FTP & SFTP: Works with both FTP and secure FTP (SFTP) connections.
Overwrites Existing Files: If a file exists at the target path, it will be replaced.
Error Handling: Properly manages missing files, invalid paths, and permission-related issues.
Efficient File Transfer: Enables automated file uploads to remote servers.
This component is ideal for workflows that require seamless file transfers to remote FTP/SFTP servers.
Last updated