Script

FTP

The professional tool to automate FTP, SFTP, FTPS and Batch FTP

Syntax:

DELETEFILE(file)

  • file: remote file to be deleted. Wildcard expressions and paths are allowed.

Remarks:

In order to delete an entire remote directory tree use RMDIR

Return value:

If this command has been executed successfully it will return “OK” . If it encounters an error it will return an error code.

See also:

RMDIR

Example:

# Connect to ftp.myserver.com
OPENHOST("ftp.myserver.com","myuser","mypass")
 
# Delete the remote file notes.html
DELETEFILE("notes.html")
 
# Delete the remote file lenore.sav
# under the directory foo
DELETEFILE("foo/lenore.sav")
 
# Delete every .sav file
# under the current remote directory
DELETEFILE("*.sav")
 
# Change current remote directory to
# /www
CHDIR("/www")
 
# Delete every html file under
# /www/images
DELETEFILE("images/*.html")
 
# Close the connection
CLOSEHOST