This article covers a few examples of Sending files with FTP (or FTPS).
Note: SFTP is not FTP, please click here if you need SFTP ;-)
Good practice: using an FTP metadata
A Stambia Process can connect to an FTP server with the "Send files with FTP" action (also known as "FtpPut").
One can set the action's properties directly, or setup an FTP Metadata, which provides benefits such as Configurations, Impact analysis, Metadata management in Analytics, etc.
We recommend to setup an FTP Metadata (and this article respects this recommendation).
Sending a single file to an FTP server
In this example, we want to send a Local file (local to the Runtime) to the remote FTP Server.
Steps to create the process:
- Create the FTP Server metadata and a TargetDir folder
- Add a "Send files with FTP" action from the Palette
- Drag and drop the FTP Server's target directory from the FTP Metadata to the FtpPut action
- Set the FTP_LOCAL_FILENAME property to the local file path, e.g. "d:/temp/screen.png"
- Uncheck "Multiple Mode" because we want to transfer only one file
Note the (1) red circle: these properties are automatically set from the Metadata.
After execution: the FILE_NB variable confirms we have transferred 1 file.
Sending multiple files to an FTP Server
This time, we want to send all the files from a local directory, having a ".png" file extension.
Here is how we setup the FtpPut action:
- Make sure "Multiple Mode" is checked
- Local Path is the local directory containing the files
- Local Filename is the pattern for the file names : *.png
After execution: FILE_NB shows that we have sent 6 files.