(Lianja) Delete Remote File
Delete a remote file.
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loFtp = createobject("CkFtp2")
loFtp.Hostname = "ftp.chilkatsoft.com"
loFtp.Username = "myLogin"
loFtp.Password = "myPassword"
// Connect and login to the FTP server.
llSuccess = loFtp.Connect()
if (llSuccess <> .T.) then
? loFtp.LastErrorText
release loFtp
return
endif
// Set the current remote directory to where the file
// is located:
llSuccess = loFtp.ChangeRemoteDir("/testing")
if (llSuccess <> .T.) then
? loFtp.LastErrorText
release loFtp
return
endif
llSuccess = loFtp.DeleteRemoteFile("goodbye.txt")
if (llSuccess <> .T.) then
? loFtp.LastErrorText
release loFtp
return
endif
llSuccess = loFtp.Disconnect()
release loFtp
|