Connect to an FTP Server Example - Mule 4
To configure the global element to connect to an FTP server, follow these steps:
-
Select the name of the connector in the Studio canvas.
-
Select the operation in the Studio canvas.
-
In the configuration screen for the operation, click the plus sign (+) next to Connector configuration to access the global element configuration fields.
-
On the General tab, specify the connection information for the connector.
-
Set Working Directory to
${workingDir}
.
This is the root of every relative path used with this connector. The value defaults to the remote server. -
Set Host to specify the SFTP server host, for example,
localhost
or192.168.0.1
. -
Set Port to
${ftpPort}
. -
Set Username to
anonymous
and Password topassword
. -
On the Advanced tab, optionally specify the timeout configuration and reconnection strategy.
-
Click Test Connection to confirm that Mule can connect with the specified server.
-
Click OK.
In the Configuration XML tab of your Studio canvas, the configuration ftp:config
looks like this:
<ftp:config name="FTP_Config" doc:name="FTP Config" doc:id="" >
<ftp:connection workingDir="${workingDir}" host="localhost"
port="${ftpPort}" username="anonymous" password="password" />
</ftp:config>