Sending FTP Commands can be useful to create directory structures, send, move, get, delete files, and more...
You will learn in this article how to send FTP Commands to an FTP Server with Stambia.
You will learn for this how to create an FTP Metadata and how to use it in a Process to send FTP Commands.
Sending FTP Commands to an FTP Server
FTP Metadata creation
When you want to send FTP Commands to an FTP Server, the first step is to prepare the connection settings to this server.
For this, create an FTP Metadata and define your connection properties.
Creation of an FTP Metadata
Definition of FTP Connection Properties
You can define directories in this Metadata, which can be used in Processes to perform operations directly on those directories.
Sending FTP Commands in a Process
FTP commands can be sent from a Stambia Process.
There are dedicated Process actions in Process Palette to execute FTP Commands.
To execute FTP Commands, create an Execute FTP Command Process Action and then drag and drop your FTP server Metadata on it.
Example of FTP Command Process Action creation
Configure the additional parameters of the Process Action if needed, and finally enter the list of commands you want to execute on the FTP server.
Example of commands list
That's it, you can now execute the Process.
You'll have the result in the variables published on the action after execution.
After the execution, the output is returned in "RET_MESS" variable.
Which FTP commands can I use in this Process Action?
There are two types of FTP Commands:
|FTP Command aliases||Corresponds to the most commonly used commands by FTP clients such as the command lines tools on Windows or Linux which allows to use commands aliases which are translated behind the scenes to FTP RAW commands.||mkdir, cd, put, dir, ...|
|FTP RAW Commands||Corresponds to the low-level commands which are send to FTP servers, and which are defined in FTP specification.||MKD, CWD, PWD, ...|
The type of FTP commands you can enter in your Process Action depends on the FTP Command Process Action you are using.
|Execute FTP Command||
This action supports both executing FTP Command aliases and FTP RAW Commands.Refer to the reference documentation of the action for further information, most notably for the exact list of FTP Commands aliases supported and the list of variables published by the action.
|Command with FTP||
This action supports only FTP RAW Commands
It is the original action which is deprecated now in latest Stambia DI versions.