Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter TwelveInternet Functions (continued)

FTPOpenConnection Function

Overview

The FTPOpenConnection function opens a connection to remote FTP server and returns an FTP Object.

Syntax/Parameters

Syntax

handle = FTPOpenConnection ( string server, [string username], [string password],
                        [int port], [boolean passive] );

Parameters

server

A string containing the host name or IP address of the FTP server. The string should be the domain name only, do not proceed the string with ‘ftp:’ or any other information. Alternately, the string can contain the IP number of the site, in ASCII dotted-decimal format (for example, 11.0.1.45).

username

An optional string specifying the user name. If the username is omitted, the default value is “anonymous”.

password

An optional string specifying the user password. (Note that FTP sends information in clear text.)

port

An integer specifying an optional initial port, defaults to 21. Note that the FTP service will open additional ports. If the value is less than 1, it will default to 21. The username and password must be provided to use this parameter.

passive

A boolean when set to TRUE (1) sets the FTP connection to run in passive mode. The port must be set to use this option. The host server must support passive mode to use this option.

Return Value

A handle to an FTP Connection Object or NULL_HANDLE (0) on error. Use the GetLastError and GetLastErrorMessage functions to retrieve additional details.

Remarks

Legato FTP function employs the Windows WinINET internet connection functionality and must work within the limitations (and problems) of WinINET. If a script experiences temperamental connections, the script may need to close and reopen the connection.

If difficulties and delays occur in using FTP functions, consider setting the passive option. By default, the FTP connection is in active mode where the server (host) can establish connections back to the client. While port 21 is the default port for FTP, once a connection has been established FTP functions support opening multiple additional ports. Many firewalls either may not allow or support such port forwarding requests from an external source. In passive mode, the client establishes all port connections and reduces the burden on firewalls and proxies to deal with the FTP connections. However, the host must support and respond to the PASV (passive) command for this option to operate correctly.

Proper security precautions should be employed when storing and using passwords. This function abides by the Secure Memory Model.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic