FTPCommand Method
Class: FTP_SERVICE
Description:Send native FTP command to FTP server
Send native FTP command to FTP server.
Object.FTPCommand
Parameter
lcCommand
FTP Command
Type Character
Direction Input
String value that contains the command to send to the FTP server.
liFlags
Value that contains the flags that control this method
Type Integer
Direction Input
Optional  
This can be set to one of the following values: List of types
ValueDescription
FTP_TRANSFER_TYPE_ASCIIASCII mode
FTP_TRANSFER_TYPE_BINARYBinnary mode.
liContext
Flag of returning FTP command handle
Type Integer
Direction Input
Optional  
lihFTP
Handle of FTP command
Type Integer
By reference  
Direction Input/Output
Optional  
If you want receive this value, liContext must be true.
Example
LOCAL loFTP,lcPom #INCLUDE "ftp.h" SET PROCEDURE TO ftp.prg ADDITIVE loFTP=CREATEOBJECT('ftp_service') IF loFTP.OpenInternet("ABONNE", "PWD", "10.10.10.10", "21") =loFTP.FtpCommand("SIZE any.txt", FTP_TRANSFER_TYPE_BINARY,0,.NULL.) ?loFTP.GetExtendedErrorCode() && 0 ?loFTP.GetExtendedErrorMsg() && 213 file size =loFTP.FtpCommand("NOOP", FTP_TRANSFER_TYPE_BINARY,0,.NULL.) =loFTP.CloseInternet() ENDIF RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure FTPCommand Source Code
      LPARAMETERS INP lcCommand,INP liFlags,OPT_INP liContext,OPT_CHNGREF lihFTP
      LOCAL fResult
      liFlags=IIF(PCOUNT()<2,FTP_TRANSFER_TYPE_BINARY,m.liFlags)
      liContext=IIF(PCOUNT()<3,0,m.liContext)
      lihFTP=IIF(ISNULL(m.lihFTP),-1,0)

      lcCommand = m.lcCommand + cNULL
      =This.BeforeFTPCommand(@m.lcCommand, m.liFlags, m.liContext,m.lihFTP)
      fResult = FtpCommand(This.nConnect_Handle, IIF(m.lihFTP=-1,0,1), m.liFlags, @m.lcCommand,m.liContext,@m.lihFTP)

      =This.GetExtendedError()
      =This.AfterFTPCommand(@m.lcCommand, m.liFlags, m.liContext,m.lihFTP,m.fResult)

      =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection())   && Close FTP Handle
      RETURN  m.fResult = 1