DeleteFTPFile Method
Class: FTP_SERVICE
This method can only delete files off of the FTP Server that are not read only or some how protected by the server.
=
Object.DeleteFTPFile
Parameter
lcRemoteFile
Remote file name
Type Character
Direction Input
Name and Path of the File to delete on the FTP Server.
Return value boolean
Returns .T. if the function successfully deleted the file from the FTP Server. Returns .F. if the function could not delete the file.
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")
   IF !loFTP.DeleteFTPFile("any.txt")
      ?loFTP.GetExtendedErrorCode(),loFTP.GetExtendedErrorMsg()
   ENDIF
   =loFTP.CloseInternet() 
ENDIF
RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure DeleteFTPFile Source Code
      LPARAMETERS INP lcRemoteFile
      LOCAL fResult
      IF This.OpenFTPConnection(This.cCurrentDir)     && Open an FTP Handle
         lcRemoteFile = lcRemoteFile + cNULL

         =This.BeforeDeleteFTPFile(@lcRemoteFile)
         fResult = FtpDeleteFile(This.nConnect_Handle, @lcRemoteFile)
         This.GetExtendedError()
         =This.AfterDeleteFTPFile(@lcRemoteFile,fResult)
         =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection())   && Close FTP Handle
         RETURN fResult = 1
      ENDIF
      RETURN .F.