Prerequisite
- A Braincube IoT Server
- The application FTP/SFTP install (see appsmanager to install new application)
- A machine with a FTP/SFTP Server installed and accessible
The node settings
Once the application FTP/SFTP installed you will find new nodes in your node palette:
- FTP
- SFTP

FTP
FTP in
The ftp-in node is designed to help you read data from a FTP application.
You can easily drag and drop this node from the palette to your dataflow and start working with it. The first thing to do is to set up your FTP server.

To start with this node you will create a new "FTP endpoint" by opening the dropdown menu, choose "Add new FTP Server" and click on the "edit" button. You will then access this page where you have one tab for the settings we have to work on:
About the server connection ftp-in requires :
- Host: an IP Address which is the IP of the ftp-in you want to connect to
- User: is username for authentication
- Password: is Password for authentication
- Port: 21 is the standard port used by ftp protocol, change it if you use a specific port in your implementation
- Connection Timeout : is how long (in seconds) to wait for the control connection to be established
- PASV Timeout : is how long (in seconds) to wait for a PASV data connection to be established.
- Keepalive : is how often (in seconds) to send a 'dummy' (NOOP) command to keep the connection alive.
- Data connection encryption : is set to true for both control and data connection encryption. This is used for FTPS
- Implicit encryption : Set to true if the targeted FTP server runs pure FTPS and not FTP with opt-in encryption. This is used for FTPS
- Secure Options : additional options to be passed to tls.connect() written in JSON format. Like {"rejectUnauthorized": true}
Once you set up this you can click on Add, Done, Deploy to save the settings and then come back to this node configuration.

Operations
- list : returns an array of the file/folders in the user's default sftp folder, containing type, name, sticky, rights(an object), acl, owner, group, size and date.
- get : uses msg.payload.filename and output to msg.payload.filedata/code
- put : uses msg.payload.filename and msg.payload.filedata
- delete : uses only msg.payload.filename
In the properties of connector it is possible to select a specific folder to work in the field "Working Directory" or leave it blank if you will use the root directory.
If the operation selected is get, put or delete you need specify the name of the file in the field "Filename"
Is possible pass this parameters in the input of connector changing the keys "msg.payload.workdir" and "msg.payload.filename"

The PUT function in FTP is used to upload (transfer) a file from the local system (the client) to the remote server. It allows users to send files securely to a specific directory on the server. When using the PUT command, the client specifies the source file's location on their local machine and the destination directory on the remote server.
The GET function in FTP is used to download (retrieve) a file from the remote server to the local system (the client). It allows users to securely fetch files from the server and save them on their local machine. When using the GET command, the client specifies the file's location on the remote server and the destination directory on their local machine.
The LIST function in FTP is used to retrieve a directory listing of files and directories present on the remote server. It provides information about the files' names, sizes, timestamps, and permissions. This command is helpful for users to browse the content available on the server without actually downloading the files.
The DELETE function in FTP is used to remove files from the remote server. It allows users to delete files from a specific directory on the server. Caution should be exercised while using this command, as the deleted files cannot be easily recovered.
SFTP
SFTP-in
The sftp-in node is designed to help you read data from a SFTP application.
You can easily drag and drop this node from the palette to your dataflow and start working with it. The first thing to do is to set up your SFTP server.
To start with this node you will create a new "SFTP endpoint" by opening the dropdown menu, choose "Add new SFTP…" and click on the "edit" button. You will then access this page where you have one tab for the settings we have to work on:
About the server connection ftp-in requires :
- Host: an IP Address which is the IP of the sftp-in you want to connect to
- User: is username for authentication
- Password: is Password for authentication
- Port: 22 is the standard port used by sftp protocol, change it if you use a specific port in your implementation
- Keepalive : is how often (in seconds) to send a 'dummy' (NOOP) command to keep the connection alive.
- hmac : is a set of message authentication methods
- cipher : is the set of cipher that are usable for encryption
Once you set up this you can click on Add, Done, Deploy to save the settings and then come back to this node configuration.

Operations
- list : returns an array of the file/folders in the user's default sftp folder, containing type, name, sticky, rights(an object), acl, owner, group, size and date.
- get : uses msg.payload.filename and output to msg.payload.filedata/code>
- put : uses msg.payload.filename and msg.payload.filedata
- delete : uses only msg.payload.filename
In the properties of connector it is possible to select a specific folder to work in the field "Working Directory" or leave it blank if you will use the root directory.
If the operation selected is get, put or delete you need specify the name of the file in the field "Filename"
Is possible pass this parameters in the input of connector changing the keys "msg.payload.workdir" and "msg.payload.filename"

The PUT function in SFTP is used to upload (transfer) a file from the local system (the client) to the remote server. It allows users to send files securely to a specific directory on the server. When using the PUT command, the client specifies the source file's location on their local machine and the destination directory on the remote server.
The GET function in SFTP is used to download (retrieve) a file from the remote server to the local system (the client). It allows users to securely fetch files from the server and save them on their local machine. When using the GET command, the client specifies the file's location on the remote server and the destination directory on their local machine.
The LIST function in SFTP is used to retrieve a directory listing of files and directories present on the remote server. It provides information about the files' names, sizes, timestamps, and permissions. This command is helpful for users to browse the content available on the server without actually downloading the files.
The DELETE function in SFTP is used to remove files from the remote server. It allows users to delete files from a specific directory on the server. Caution should be exercised while using this command, as the deleted files cannot be easily recovered.