FTP Function Reference

sFTPOpen

FTP Function Reference

This function establishes a connection with a remote FTP server running over an IP network.

Declare Function sFTPOpen Lib "SapphireFTP.dll" (ByVal sServer As String, ByVal lPort As Long, ByVal sUser As String, ByVal sPwd As String, ByVal lPassive As Long, ByVal lTimeOut As Long, ByVal lLicence As Long) As Long

Parameters

  sServer
    A string specifying the remote server to connect to. This can either be a domain or an IP address.
  lPort
    A long specifying the port number of the running FTP server. This value is commonly 21 for standard FTP connections.
  sUser
    A string specifying the username for the FTP account.
  sPwd
    A string specifying the password for the FTP account.
  lPassive
    A long flag specifying whether to use passive mode or not. Setting this parameter to 1 will use passive mode and setting to 0 will use active mode.
  lTimeOut
    A long value specifying the connection timeout in milliseconds.
  lLicence
    A long specifying the licence number of the registered utility. If using in demo mode, enter 1234567890.

Return Values

  Returns a number indicating success or failure. If the operation was successful then the return value will be FTP_NO_ERROR. Use sFTPErrorText to get a string version of the error message.

Remarks

  If you are calling sFTPOpen on PPC2002, please ensure that you have the latest patch called EUU2 (downloadable from your manufacturers web site) installed as early releases of the operating system would not allow FTP connections that were not anonymous.