This function sends a file to the FTP server from some local area.
Depending on how the FTP Server is setup, decides whether or not an existing file is overwritten or if the function fails to send the file.
Parameter
-
lcRemoteFile
-
Remote file name
Type |
Character |
Direction |
Input |
Name and Path for the contents of the file to be stored in.
-
lcLocalFile
-
Local file name
Type |
Character |
Direction |
Input |
Name and Path of the file to send to the FTP Server.
Returns .T.
if the function successfully copied the file to the FTP Server.
Returns .F.
if the operation failed.
Source Code
LPARAMETERS lcRemoteFile, lclocalFile
LOCAL fResult
IF This.OpenFtpConnection(This.cStartupFolder) && Open an FTP Handle
lcRemoteFile = lcRemoteFile + cNULL
lcLocalFile = lcLocalFile + cNULL
=This.BeforePutFtpFile(lcRemoteFile, lclocalFile)
fResult = FtpPutFile(This.nConnect_Handle, @lcLocalFile, @lcRemoteFile, ;
FTP_TRANSFER_TYPE_BINARY, 0)
=This.GetExtendedError()
=This.AfterPutFtpFile(lcRemoteFile, lclocalFile,fResult)
=IIF(This.lMultiOperations,.T.,This.CloseFtpConnection()) && Close FTP Handle
RETURN fResult = 1
ENDIF
RETURN .F.