wwftp::FtpDeleteFile

Deletes a file on the FTP server.

o.FTPDeleteFile(cFileName)

Return Value

numeric - Windows API or WinInet API error code. 0 - on success, other on failure

Parameters

cFileName
The filename to delete on the server. This filename can include a FTP server relative path such as "/uploads/somefile.txt". No wildcards are allowed.

Remarks

This method requires that you manually call FTPConnect and FTPClose to open and close the FTP session.

In order to delete files you have to have the appropriate rights on the server.

Example

oFTP = CREATE("wwFTP")

oFTP.FTPConnect("ftp.west-wind.com","jdoe","hispassword")

IF  oFTP.DeleteFile("/uploads/somefile.txt") # 0
   ? oFTP.cErrorMsg
   RETURN
ENDIF

? "File deleted..."

oFTP.FTPClose()

See also:

Class wwFtp (deprecated) | wwFTP::FTPConnect

© West Wind Technologies, 2024 • Updated: 09/06/11
Comment or report problem with topic