WebFtpDeleteFile Function

Action

Deletes a file stored on the FTP server.

Include file

WebAPI.bdh

Syntax

WebFtpDeleteFile( in hFtp      : number, 
                  in sFileName : string ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hFtp Valid handle to an FTP session. This handle must have been returned from a previous call to WebFtpConnect.
sFileName Null-terminated string that contains the name of the file to delete on the remote system
注: The sFile parameter can be either partially or fully qualified file names relative to the current directory. A backslash (\) or forward slash (/) can be used as the directory separator for either name. WebFtpDeleteFile translates the directory name separators to the appropriate character before they are used.

Example

// Deletes a file on the FTP server. 
dcltrans 
  transaction TWebFtpDeleteFile 
  var
    hFtp: number; 
  begin
    WebFtpConnect(hFtp, "standardhost", WEB_PORT_FTP, 
                  "anonymous", "mymail@address.com"); 
    WebFtpDeleteFile(hFtp, "renamed_test_file.txt");
    WebFtpShutdown(hFtp); 
  end TWebFtpDeleteFile;

Sample scripts

WebMulti01.bdf

SilkEssential sample

Ftp.sep