Altova FlowForce Server 2024 Advanced Edition

Uploads a file from a local directory to an FTP server.

 

Parameters

Name

Type

Description

FTP Server

string

Mandatory parameter. Address of a remote FTP server, as a URL or IP address.

Port

number

Optional parameter. The port number used to connect to the FTP server. The default value is 21.

Directory on host

string

Optional parameter. The name of a directory on the remote FTP server, to which you want to upload a file.

Login credentials

credential

Optional parameter. The username and password of the FTP account. For details, see Credentials. Skip this parameter if the FTP server does not require credentials.

Use passive mode

boolean

Optional parameter. Use the passive mode if connection problems occur (e.g., if routers or firewalls are set up to prevent active connections). The default value is true.

Use SSL/TLS encryption

string

Optional parameter. The default value is No. To transfer information, FTP uses a command channel and a data channel. If you would like to transfer FTP data without encryption, leave the default value. Otherwise, set this value to one of the following:

 

Explicit with encrypted command channel

Explicit with encrypted command and data channel

 

If you set any of the two options above, the validation of the server certificate will depend on the value of the Verify server certificate parameter. Implicit encryption is deprecated and not supported in FlowForce.

Verify server certificate

string

Optional parameter. Specifies how FlowForce should verify the FTP server's certificate. The following options are available:

 

No verification: Accepts any FTP server certificate.

Verify against system certificate store (default value): On Windows, FlowForce Server uses the certificate store of the user account running the job and the system store to verify the certificate signature. On Linux, FlowForce Server uses the system certificate store, usually located in /usr/lib/ssl/cert.pem and /usr/lib/ssl/certs, or the path to which the SSL_CERT_FILE and SSL_CERT_DIR environment variables point.

Verify against selected server certificate: FlowForce compares the FTP server's certificate with the one specified in the Server Certificate parameter.

 

This parameter requires a server certificate and a secure connection. If a secure connection cannot be established, the FTP function will fail.

Server certificate

certificate

Optional parameter. Specifies the path to a FlowForce certificate. If you select Verify against selected server certificate in the Verify server certificate parameter, the FlowForce certificate will be verified against the FTP server certificate. If you select No verification or Verify against system certificate store in the Verify server certificate parameter, the Server certificate parameter value will be ignored.

Source file

string

Mandatory parameter. The name of a local file you want to upload to the FTP server.

 

If you use a relative path, it will be resolved against the path specified in the Working directory parameter. If you use the absolute path, the path in Working directory will be ignored.

Target file

string

Mandatory parameter. The name of the uploaded file that will be stored on the FTP server.

 

If you use a relative path, it will be resolved against the path specified in the Directory on host parameter. If you use the absolute path, the path in Directory on host will be ignored.

Abort on error

boolean

Optional parameter. This parameter determines the outcome of a job in which an error has occurred. If the Abort on error parameter is true, job execution will be terminated. If the Abort on error parameter is false, FlowForce Server will ignore errors and continue job execution. The default value is true.

Working directory

string

Optional parameter. Specifies the local working directory, from which a file will be uploaded to the FTP server.

Account

string

Optional parameter. The FTP account name of the user that has access to the files on the remote server.

 

 

Example

This example shows you how to upload a file from a local directory to a remote FTP server, without knowing the file name and extension at job configuration time.

 

Set a trigger

To upload a file without knowing its name and extension, we need to set a file system trigger. The trigger shown below monitors the C:\FlowForce\Upload directory for changes. Whenever there is a change in this directory, the job fires, and the absolute path of the file that triggered the job becomes available in the triggerfile input parameter (subsection below).

fs_func_ftp_store_01

Add an execution step

The execution step below calls the store function to upload a file from the local directory (C:\FlowForce\Upload) to the uploads directory on the FTP server. Every time a change is detected in the local working directory, the job will fire, and the store function will upload the file in which the change has occurred to the FTP server. Since we have already indicated the local working directory, it is sufficient to use the relative path of the triggerfile in the Source file parameter. For the target file, we must use the relative path of the triggerfile so that it is resolved correctly against the directory on the FTP server.

 

In the Source file and Target file parameters, we use the file-with-extension function that takes the absolute path of the triggerfile and extracts the file name and its extension. For example, if the triggerfile were C:\FlowForce\Upload\Example.txt, the expression would return Example.txt.

fs_func_ftp_store_02

 

© 2017-2023 Altova GmbH