Home > Language Reference > FTP Functions > FTPKill

FTPKill

The FTPKill function deletes the specified file(s) on the FTP server.

Usage

Used to delete files on a FTP server.

Syntax

ret=FTPKill(<FTP_filename>)

Parameters

<FTP_filename>, string, name of the file(s). Wildcards (* or ?) may be used to delete several files matching a certain mask.

Return value

Ret, optional numeric return value. If the function succeeds deleting the file(s) within 30 seconds (this default value can be changed using #FTPTimeout), the function returns 0. If the function fails, the return value is a nonzero negative value (see FTP Functions Error Codes).

Remarks

FTPKill reports an error if the specified to delete does not exist on the FTP server. You can use FTPExistFile function to check the existence of a file before deleting it.

See also

FTPExistFile

Example

FtpConnect("www.my_site.com","ftp","MX/WH05CZE3h") ' connection to the FTP server www.my_site.com (fake credentials!)
FtpKill("/upgrades/todelete/*.jpg") ' deletes all the files with the jpg extension from the folder /upgrades/todelete
FtpCurrentDir(var$) ' var$ contains /upgrades/todelete
FtpDisconnect() ' Terminates the FTP connection