FTPSetConfig

Command group Flag affected Reversible Execute on client Platform(s)
External commands YES NO NO All

Syntax

FTPSetConfig (proc[,activeonly {Default zero for no;1 for yes}]) Returns  status

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This Web command is multi-threaded, allowing another thread to execute in the multi-threaded server while it runs. Note that the same socket cannot safely be used concurrently by more than one thread.

FTPSetConfig provides the FTP commands with configuration information.

Proc is an Omnis Character field containing the name of an Omnis method used to report the progress of FTP operations which transfer data (FTPGet, FTPGetBinary, FTPList, FTPPut and FTPPutBinary); for example MYLIBRARY.MYCODE/MYPROC. You can clear the current setting for the FTP progress proc, by passing an empty value.

ActiveOnly is an optional parameter. A value of 1 causes all FTP over non-secure connections to be active, rather than the default, which is use passive FTP if the server supports it (if the connection is secure then only passive FTP can be used). Normally, you would not select ActiveOnly FTP; this is provided as a possible work-around for servers with which passive FTP is causing problems. You can find a fuller explanation below of passive and active FTP.

Status receives the result of executing this command. Possible error codes are listed in the Web Command Error Codes Appendix.

FTP data transfer commands call the progress proc (if specified) while data transfer is in progress. This allows you to indicate progress to the user. The commands call the progress proc with three parameters:

The FTP data transfer commands always first attempt to use passive mode to transfer data. In passive mode, the client initiates the data connection to the server. This is the recommended mode of operation (see RFC1579, "Firewall Friendly FTP). Most FTP servers support passive mode, although there are some which do not. In this case, if the attempt to use passive mode fails, the FTP commands use active mode to transfer data. In this case, the server initiates the data connection to a port on the client.

Example

; setup the config method
FTPSetConfig ('cCode/FTPProgress')
; Then in code class cCode/FTPProgress
; 3 parameter variables (all defined as long integer)
OK message {Socket [pSocket] - TransferredSoFar [pTransferredSoFar] - TotalToTransfer [pTotalToTransfer]}