Command FTP_SetPassive

4D Internet Commands

FTP_SetPassive

version 6.5.3 (Modified)


FTP_SetPassive (ftpID; passiveMode) Integer

ParameterTypeDescription
ftpIDLongintReference to a FTP login
passiveModeInteger0=Active mode, 1=Passive mode (default mode)

Function result Integer Error Code

Description

The FTP_SetPassive command sets the data stream transfer mode between an FTP Server and an FTP Client while executing commands such as FTP_GetDirList, FTP_Send, FTP_Append or FTP_Receive. Data stream transfer mode setting will be applied to these commands once the command FTP_SetPassive has been executed.

Exchanges between a FTP Server and a FTP Client are based upon two streams: the control stream (port 21 by default) and the data stream (port 20 by default). Usually, FTP Servers are defined as "active" since they open and manage the data connection.

For historical reasons, 4D Internet Commands default data stream transfer mode consists of asking the FTP Server to work in Passive mode. It means that prior to each exchange on the data stream, the FTP command "PASV" is sent.

However, some FTP Servers do not support the passive mode, and also firewalls may not allow it. In these cases, you will need to set the active mode as the current data stream transfer mode.

Note: You may need to check with the network administrator whether the active or the passive mode is used for FTP exchanges.

ftp_ID is the long integer reference to the FTP session established with FTP_Login.

The passiveMode parameter value specifies the data stream transfer mode:

• a value of 0 will specify the FTP Server to work in Active mode

• a value of 1 will specify the FTP Server to work in Passive mode (default value).

See Also

FTP_GetPassive.