Class: | FTP_SERVICE |
Description: | Sends a file to the FTP server from some local area |
Type | Character |
Direction | Input |
Type | Character |
Direction | Input |
Type | Numeric |
Direction | Input |
Value | Description |
FTP_TRANSFER_TYPE_ASCII | Transfers the file as ASCII. |
FTP_TRANSFER_TYPE_BINARY | Transfers the file as binary. |
LPARAMETERS INP lcRemoteFile, INP lcLocalFile, INP lnFlag LOCAL fResult IF EMPTY(m.lcRemoteFile) This.SetExtendedError(_FTPS_UE_FNDEF,"lcRemoteFile") RETURN .F. ENDIF IF EMPTY(m.lcLocalFile) This.SetExtendedError(_FTPS_UE_FNDEF,"lcLocalFile") RETURN .F. ENDIF lnFlag=IIF(PCOUNT()<3,FTP_TRANSFER_TYPE_UNKNOWN,m.lnFlag) IF This.OpenFTPConnection(This.cCurrentDir) && Open an FTP Handle lcRemoteFile = m.lcRemoteFile + cNULL lcLocalFile = m.lcLocalFile + cNULL =This.BeforePutFTPFile(@m.lcRemoteFile, @m.lclocalFile,m.lnFlag) fResult = FtpPutFile(This.nConnect_Handle, @m.lcLocalFile, @m.lcRemoteFile, ; BITOR(This.nCachingType,m.lnFlag), 0) =This.GetExtendedError() =This.AfterPutFTPFile(@m.lcRemoteFile, @m.lclocalFile,m.lnFlag,m.fResult) =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection()) && Close FTP Handle RETURN m.fResult = 1 ENDIF RETURN .F.