Xbase++
Xbase++
Delete Remote File
See more FTP Examples
Delete a remote file.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oFtp
nSuccess := 0
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oFtp := CreateObject("Chilkat.Ftp2")
oFtp:Hostname := "ftp.chilkatsoft.com"
oFtp:Username := "myLogin"
oFtp:Password := "myPassword"
// Connect and login to the FTP server.
nSuccess := oFtp:Connect()
IF (nSuccess != 1)
? oFtp:LastErrorText
oFtp:destroy()
RETURN
ENDIF
// Set the current remote directory to where the file
// is located:
nSuccess := oFtp:ChangeRemoteDir("/testing")
IF (nSuccess != 1)
? oFtp:LastErrorText
oFtp:destroy()
RETURN
ENDIF
nSuccess := oFtp:DeleteRemoteFile("goodbye.txt")
IF (nSuccess != 1)
? oFtp:LastErrorText
oFtp:destroy()
RETURN
ENDIF
nSuccess := oFtp:Disconnect()
oFtp:destroy()