GetFileSize Method
Class: FTP_SERVICE
Get file size.
=
Object.GetFileSize
Parameter
lcFile
Remote file name
Type Character
Direction Input
lnSize
File size
Type Number
By reference  
Direction Input
Return value Boolean
The return value is .T. if getting file size or .F. is not.
Example
LOCAL lnFileSize,lcPath,loFTP
#INCLUDE "ftp.h"
SET PROCEDURE TO ftp.prg ADDITIVE 
loFTP=CREATEOBJECT('_myftp') 

IF loFTP.OpenInternet("anonymous", "gorila@gorila.cz","192.168.2.21", "21")

    =loFTp.ChangeFTPDirectory("Kubuntu704")
    IF loFTP.GetFileSize("test.rar",@lnFileSize)
       ?lnFileSize
    ENDIF

   =loFTP.CloseInternet() 
ENDIF
RELEASE PROCEDURE ftp.prg

DEFINE CLASS _myFTP AS FTP_SERVICE
   PROCEDURE BeforeGetFileSize(lcFile,lnSize)
      ?PROGRAM(16)
      ?CHR(9),lcFile,lnSize
   ENDPROC

   PROCEDURE AfterGetFileSize(lcFile,lnSize,llRet)
      ?PROGRAM(16)
      ?CHR(9),lcFile,lnSize,llRet
   ENDPROC

ENDDEFINE 
See also
Expand/Collapse source code of procedure GetFileSize Source Code
      LPARAMETERS INP lcFile, CHNGREF lnSize
      LOCAL lcPom,llRet
      IF This.OpenFTPConnection(This.cCurrentDir)     && Open an FTP Handle
         lcFile = ALLTRIM(lcFile)+cNULL

         =This.BeforeGetFileSize(@lcFile, lnSize)
         *!* FtpGetFileSize does not work as expected for files greater then 4Gb (dwFileSizeHigh always NULL)
         *!* http://groups.google.com.ar/group/microsoft.public.windows.inetexplorer.ie5.programming.wininet/browse_thread/thread/3c118ed4c7c32269/791a868311e60a00?lnk=st&q=ftpfindfirstfile+and+large+files&rnum=2&hl=es#791a868311e60a00

         llRet=This._FTPCommand("SIZE "+lcFile,0,0,.NULL.)
         IF llRet
            lcPom=This.GetExtendedErrorMsg()
            lnSize=VAL(SUBSTR(lcPom,AT(" ",lcPom)+1))
         ENDIF

         =This.AfterGetFileSize(@lcFile,lnSize,llRet)
         =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection())   && Close FTP Handle
         RETURN llRet
      ENDIF
      RETURN .F.