FTP Connector
Properties Configuration Settings
The FTP Component adds SSL-enabled FTP send and receive capabilities to your MuleSoft.
Remarks
The FTP Connector adds a complete FTP client to your Mule Project and enables it with plaintext or SSL-secured file download and upload capability.
FTP Receive Connector
The FTP Receive Connector will establish a connection to a server and download a group of files. A single property must be set: FTPServer. You may also set an FTPPort if the server is not set to the default protocol port. If your FTP server requires authentication, you should set the User, Password and/or Account properties. If you wish to enable SSL, you can turn it on by setting an appropriate SSLCert and SSLStartMode as well as supplying an SSLAcceptServerCert.
The connector will connect to the FTP server every PollingInterval and list the directory specified by RemotePath. All files that match the FileMask will be downloaded and submitted to the Mule Project as individual Mule Messages. In order to guarantee that files are not downloaded multiple times, you may set the DeleteMode. If you wish to do any other PRE- or POST-GET operation, you can specify them as scripts through the BeforeGet and AfterGet properties, respectively.
Download Example
Drag and drop the FTP Receive Connector into the source position of a flow. All that is necessary to get started is to configure the connection settings.
Just as an example, say you want to download a group of files stored on a remote machine in /home/Bob/files. To configure the connector, one option is to specify a RemotePath of /home/Bob/files and an empty FileMask. Since FileMask defaults to *.*, all files in the RemotePath will be downloaded.
The connector will generate one mule event for each file in the remote location. Use a File Write connector behind the FTP Receive connector to write the files to disk.
The received filename is available in the ReceivedFileName attribute on each Mule Message. To write the entire group of files to disk, you can set the Path property of the File Write connector to the following DataWeave code:
"C:\\my\\files\\" ++ attributes.ReceivedFileName
The Content can be left as payload. That is all that is required to begin downloading files.
FTP Send Connector
The FTP Send Connector will establish a connection to a server and upload a file. Two properties must be set: FTPServer and a RemoteFile. If your server does not operate on the default FTP port, you will need to specify the correct port via FTPPort. For servers that do not allow anonymous uploads, you may also need to set User, Password, and/or Account. To enable SSL, you should select a client SSLCert and a SSLAcceptServerCert as well as an SSLStartMode.
The connector will connect to the FTP server whenever it has a message to send. The connector will attempt to upload to the specified RemotePath. In order to prevent parallel processing by another application before your upload is complete, you may need to set a temporary extension via TemporaryUploadExtension. If Overwrite is set to True, the connector will delete or overwrite remote files as necessary to complete the operation.
If you wish to do any other PRE- or POST-PUT operation, you can specify them as scripts through the BeforePut and AfterPut properties, respectively.
Upload Single Example
To get started, add a File Read connector in front of the FTP Send connector and configure it to read a particular target file. The bytes in the payload of the incoming Mule Message are uploaded as a single file.
There is no need to transform the output of the File Read connector before passing it to the FTP Send connector. Configure the FTP Send connector with the above connection settings. That is all that is required to upload the file.
Upload Multiple Example
The Send operation only uploads a single file at a time so we will need to perform the Send operation once for each file.
To get started, add a File List connector to your flow and configure it to list a target folder. The output payload of File List is an Array of file content and a set of attributes for each file.
Behind the File List connector add a For Each Scope and configure it to iterate over the message payload. Inside the For Each Scope, add a FTP Send operation and configure it with the above connection settings.
Set the RemoteFile property dynamically with DataWeave to preserve the uploaded filename. To do this, click the Mule Expression indicator on the RemoteFile property and add the following DataWeave code:
"/home/Spencer/files" ++ attributes.fileName
That is all that is required to upload a group of files.
Receiver Property List
The following is the full list of the properties of the receiver connector with short descriptions. Click on the links for further details.
AfterConnect | A set of FTP commands to be executed immediately after connecting to the FTPServer . |
AfterGet | A set of FTP commands to be executed after the GET. |
BeforeGet | A set of FTP commands to be executed before the GET. |
DeleteMode | Controls if and when the remote file is deleted after download. |
FileMask | Indicates the type of files to download from the FTP server. |
Firewall | A set of properties related to firewall access. |
FTPPort | The port for the FTP service (default is 21). |
FTPServer | The domain name or IP address of the FTP server. |
LogFile | The file to write logging information to at runtime. |
LogMode | What information gets logged during component execution. |
LogType | How information gets logged during component execution. |
Other | Defines a set of configuration settings to be used by the component. |
Passive | Controls whether to direct the server into passive mode. Recommended if behind a firewall. |
Password | The password for login. |
PersistentConnection | Instructs the component whether to keep the connection to the server open. |
ReceivedFileDate | The date of the remote file received by the FTP component. |
ReceivedFileName | The name of the remote file received by the FTP component. |
ReceivedFilePath | The remote path of the file received by the FTP component. |
ReceivedFileSize | The size of the remote file received by the FTP component. |
ReceivedFileUser | The user name used by the FTP component when downloading the remote file. |
RemotePath | The current path in the FTP server. |
RuntimeLicense | Specifies the component runtime license key. |
SSLAcceptServerCert | Instructs the component to unconditionally accept the server certificate that matches the supplied certificate. |
SSLCert | The certificate to use for client authentication during the SSL handshake. |
SSLStartMode | Determines how the component starts the SSL negotiation. |
TempPath | A temporary local directory where data can be stored before the component processes it. |
Timeout | A timeout for the component. |
TransferMode | The transfer mode (ASCII or Binary). If the value is 0 (default), the initial server mode will be used. |
User | The user id for login. |
UseSimpleDirList | Instructs the component to issue the NLST command instead of LIST. |
Sender Property List
The following is the full list of the properties of the sender connector with short descriptions. Click on the links for further details.
AfterConnect | A set of FTP commands to be executed immediately after connecting to the FTPServer . |
AfterPut | A set of FTP commands to be executed after the PUT. |
Append | Whether or not the component should append data to the RemoteFile . |
BeforePut | A set of FTP commands to be executed before the PUT. |
Firewall | A set of properties related to firewall access. |
FTPPort | The port for the FTP service (default is 21). |
FTPServer | The domain name or IP address of the FTP server. |
LogFile | The file to write logging information to at runtime. |
LogMode | What information gets logged during component execution. |
LogType | How information gets logged during component execution. |
Other | Defines a set of configuration settings to be used by the component. |
Overwrite | Whether or not the component should overwrite files during transfer. |
Passive | Controls whether to direct the server into passive mode. Recommended if behind a firewall. |
Password | The password for login. |
PersistentConnection | Instructs the component whether to keep the connection to the server open. |
ReceivedFileDate | The date of the remote file received by the FTP component. |
ReceivedFileName | The name of the remote file received by the FTP component. |
ReceivedFileSize | The size of the remote file received by the FTP component. |
ReceivedFileUser | The user name used by the FTP component when downloading the remote file. |
RemoteFile | The name of the destination file on the FTP server for uploading. |
RemotePath | The current path in the FTP server. |
RemoteTempPath | A temporary directory on the server to store files before moving them to RemotePath . |
RuntimeLicense | Specifies the component runtime license key. |
SSLAcceptServerCert | Instructs the component to unconditionally accept the server certificate that matches the supplied certificate. |
SSLCert | The certificate to use for client authentication during the SSL handshake. |
SSLStartMode | Determines how the component starts the SSL negotiation. |
Timeout | A timeout for the component. |
TransferMode | The transfer mode (ASCII or Binary). If the value is 0 (default), the initial server mode will be used. |
User | The user id for login. |
UseSimpleDirList | Instructs the component to issue the NLST command instead of LIST. |
Configuration Settings
The following is a list of configuration settings for the connector with short descriptions. Click on the links for further details.
Account | The user account to login with. |
AutoSelectDataIP | Automatically select the data connection IP. |
CheckFileExists | Whether to check if the remote file exists before uploading. |
DownloadCacheFile | When set, only new files will be downloaded from the server. |
DownloadCacheFileDuration | The number of minutes that a file name will remain in the download cache. |
EnableFileDetailsComparison | Whether the receive component should consider metadata differences when deciding whether to download a file again. |
ExcludeMask | Instructs the component to exclude some files when downloading. |
MaxFilesPerPollingInterval | The maximum number of files that will be downloaded from the server during a single poll. |
ModeZCompressionLevel | Used to specify the level of compression used. |
PortRange | Allows the specification of a port range the component listens to. |
ReusePISSLSessionInDI | Whether the PI SSL session will be reused for the DI connection. |
ReuseSSLSessionInDI | Whether the SSL session will be reused for the DI connection. |
UseClearCommandChannel | Allows for the Clear Command Channel (CCC) command. |
UseClearDataChannel | Allows for the PROT C command. |
UseEPSV | Allows extended passive mode. |
UseFSwitch | Specifies whether or not the -F parameter is used when listing directory contents. |
UseMLSD | Uses listings for machine processing. |
UseModeZ | Allows compression to be used when transferring data. |
UseProtWhenImplicit | Sends PROT P to the server. |
UseRemoteHostAddressForPassive | Instructs the component to use the FTPServer in passive mode. |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledCipherSuites | The cipher suite to be used in an SSL negotiation. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLIncludeCertChain | Whether the entire certificate chain is included in the SSLServerAuthentication event. |
SSLSecurityFlags | Flags that control certificate verification. |
TLS12SignatureAlgorithms | Defines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True. |
TLS12SupportedGroups | The supported groups for ECC. |
TLS13KeyShareGroups | The groups for which to pregenerate key shares. |
TLS13SignatureAlgorithms | The allowed certificate signature algorithms. |
TLS13SupportedGroups | The supported groups for (EC)DHE key exchange. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
TcpNoDelay | Whether or not to delay when sending packets. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |