Class: | FTP_SERVICE |
Type | Character |
Direction | Input |
Type | Character |
Direction | Input |
Type | Boolean |
Direction | Input |
LOCAL loFTP SET PROCEDURE TO ftp.prg ADDITIVE loFTP=CREATEOBJECT('ftp_service') IF loFTP.OpenInternet("ABONNE", "PWD", "10.10.10.10", "21") IF loFTP.GetFTPFile("any.txt","local.txt") ?STRTRAN("File %File% downloaded","%File%","local.txt") ELSE ?loFTP.nExtended_Result,loFTP.cExtended_Message ENDIF =loFTP.CloseInternet() ENDIF RELEASE PROCEDURE ftp.prg
LPARAMETERS lcRemoteFile, lcLocalFile, llFailIfExists LOCAL fResult, lnFail IF EMPTY(lcRemoteFile) OR EMPTY(lcLocalFile) RETURN .F. ENDIF IF This.OpenFTPConnection(This.cStartupFolder) && Open an FTP Handle lnFail=IIF(llFailIfExists,1,0) lcLocalFile = lcLocalFile + cNULL lcRemoteFile = lcRemoteFile + cNULL =This.BeforeGetFTPFile(lcRemoteFile, lcLocalFile, llFailIfExists) fResult = FtpGetFile(This.nConnect_Handle, @lcRemoteFile, @lcLocalFile, lnFail, ; FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY + This.nCachingType, 0) =This.GetExtendedError() =This.AfterGetFTPFile(lcRemoteFile, lcLocalFile, llFailIfExists,fResult) =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection()) && Close FTP Handle RETURN fResult = 1 ENDIF RETURN .F.