FTPS

Concept Link IconSee also Concept Link IconExample

Copies a file to or from an FTP server using FTPS.

WebVue support - Yes. The runtime HMI display is not supported.

Mode

Mnemonic

Syntax

1 DOWNLOAD 1
2 UPLOAD 2

Common Arguments

Argument

Meaning

HMIdisplay

Whether and how to display the progress dialog on a desktop client.

  • 0: None.
  • 1: Dialog without a Cancel button (default).
  • 2: Dialog with a Cancel button.

Type: INTEGER.

UserName The user name of the account used to access the FTP server. If omitted, an anonymous login attempt is performed. Type STR.
Password The password of the account used to access the FTP server. Type STR.
FtpSecure

A number indicating the type of FTPS connection. The default is 0.

  • 0: Explicit.
  • 1: Implicit.

Type INTEGER.

FtpTls

A number indicating the TLS version to be used. The default is 2.

  • 0: Tls 1.0
  • 1: Tls 1.1
  • 2: Tls 1.2

Type INTEGER.

Syntax 1

FTPS("DOWNLOAD", FtpsFileSource, FileDestination [, HMIdisplay [, UserName, Password [, VariableName [, FtpSecure] [, FtpTls]]]]);

Return type: INTEGER.

Argument

Meaning

FtpsFileSource The full path of the file to download e.g. "ftps://server/path”. Type STR.
FileDestination The path to the local destination for storing the file. It can be an absolute path or a relative path from the TP project directory. Type STR.
VariableName

The name of a register variable used to provide status indication.

  • 0: Transfer in progress.
  • 1: Completed.
  • 2: Canceled by the user.
  • 3: The remote server name cannot be resolved.
  • 4: Authentication failure.
  • 5: The source file for downloading does not exist.
  • 6: Logged on but permission denied.
  • 7: Transfer canceled - An error occurred.

Type STR.

If the variable does not exist, the FTP transfer may work but no status can be monitored. An information message is displayed in the Event Viewer.

Execution

Mode

Mnemonic

Action

1 DOWNLOAD

Copy a file from the FTP server to the local destination.

Return:

  • 0: No error.
  • -1: First argument is missing.
  • -2: Second argument is missing.
  • -3: Third argument is out of range.
  • -4: Unknown mode.
  • -5: The HMIDisplay is different from 0 and the HMI for file transfer is not supported in the execution context.
  • -6: The FtpSecure parameter value is incorrect.
  • -7: The FtpTls parameter value is incorrect.
  • -8: The connection is busy.

Syntax 2

FTPS("UPLOAD", FileSource, FtpsFileDestination [, HMIdisplay [, UserName, Password [, VariableName [, FtpSecure] [, FtpTls]]]]);

Return type: INTEGER.

Argument

Meaning

FileSource The full path of the file to be uploaded. It can be an absolute path or a relative path from the TP project directory. Type STR.
FtpsFileDestination The path to the FTP destination. Type STR.
VariableName

The name of a register variable used to provide status indication.

  • 0: Transfer in progress.
  • 1: Completed.
  • 2: Canceled by the user.
  • 3: The remote server name cannot be resolved.
  • 4: Authentication failure.
  • 5: The source file for uploading does not exist.
  • 6: Logged on but permission denied.
  • 7: Transfer canceled - An error occurred.

Type STR.

If the variable does not exist, the FTP transfer may work but no status can be monitored. An information message is displayed in the Event Viewer.

Execution

Mode

Mnemonic

Action

1 UPLOAD

Copy a file from the local storage to the FTP server.

Return:

  • 0: No error.
  • -1: First argument is missing.
  • -2: Second argument is missing.
  • -3: Third argument is out of range.
  • -4: Unknown mode.
  • -5: The HMIDisplay is different from 0 and the HMI for file transfer is not supported in the execution context.
  • -6: The FtpSecure parameter value is incorrect.
  • -7: The FtpsTls parameter value is incorrect.
  • -8: The connection is busy.

The HMI for file transfer

During transfer, a dialog is optionally displayed with both paths, the speed of data transfer and a progress bar. ClosedShow picture

The HMI for file transfer is not supported in WebVue. As a consequence, the HMIDisplay argument must be set to 0 for the instruction to be executed in a WebVue context. An error is returned and the instruction is not executed in WebVue context if any other value is passed.

Example

For an example, select the Example link at top of page.