FTP
Copies a file to or from an FTP server.
WebVue support - Yes. The runtime HMI display is not supported.
Mode |
Mnemonic |
Syntax |
1 | DOWNLOAD | 1 |
2 | UPLOAD | 2 |
By design, FTP is considered a weak protocol as it transmits clear-text data over a TCP/IP network. It is obsolete and shall no longer be used. Use FTPS connections and the FTPS instruction instead.
Common Arguments
Argument |
Meaning |
HMIdisplay |
Whether and how to display the progress dialog on a desktop client.
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. |
Syntax 1
FTP("DOWNLOAD", FtpFileSource, FileDestination [, HMIdisplay [, UserName, Password [, VariableName]]]);
Return type: INTEGER.
Argument |
Meaning |
FtpFileSource |
The full path of the file to download e.g. "ftp://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, but not a path to a FTP site. Type STR. |
VariableName |
The name of a register variable used to provide status indication.
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:
|
Syntax 2
FTP("UPLOAD", FileSource, FtpFileDestination [, HMIdisplay [, UserName, Password [, VariableName]]]);
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, but not a path to a FTP site. Type STR. |
FtpFileDestination |
The path to the FTP destination. Type STR. |
VariableName |
The name of a register variable used to provide status indication.
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:
|
The HMI for file transfer
During transfer, a dialog is optionally displayed with both paths, the speed of data transfer and a progress bar. Show 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.