CnfFTP
This function configures the FTP settings used by other features in the project that can transfer files, such the FTPGet and FTPPut functions.
Function | Group | Execution | Windows | Embedded | Thin Client | Mobile Access |
---|---|---|---|---|---|---|
CnfFTP | FTP | Synchronous | Supported | Supported | Supported | Not supported |
Syntax
CnfFTP( strServer, optStrUser, optStrPwn, optNumPassiveMode, optNumPort )
- strServer
- The address of the FTP server.
- optStrUser
- The username for the FTP account.
This parameter is optional; if no value is given, then the username “anonymous” is used by default.
- optStrPwd
- The password for the FTP account.
This parameter is optional; if no value is given, then the password is left blank.
- optNumPassiveMode
- A numeric flag that specifies whether Passive FTP mode is enabled. (Passive FTP can be used to bypass some firewall configurations.)
Value Description 0 Passive FTP mode is disabled (default). 1 Passive FTP mode is enabled. This parameter is optional; if no value is given, then default value is 0.
- optNumPort
- The TCP/IP port number.
This parameter is optional; if no value is given, then port 21 is used by default.
Returned value
Value | Description |
---|---|
0 | Success |
−1 | Invalid number of parameters |
−2 | Invalid server name |
−3 | Invalid user name |
Note: This function does not actually connect to the server, so these error codes do not show the quality of the connection. They only show whether the FTP settings have been successfully configured.
Notes
You must call this function at least once to configure these settings before you can use the FTPGet and FTPPut functions to transfer files.
Example
Tag Name | Expression |
---|---|
Tag | CnfFTP( “ftp.mycompany.com”, “admin”, “12345″, 1 ) // Configures the FTP server using passive mode. |