WebFtpSetCurrentDirectory Function

Action

Changes to a different working directory on the FTP server.

Include file

WebAPI.bdh

Syntax

WebFtpSetCurrentDirectory( in hFtp      : number, 
                           in sDirectory : 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.
sDirectory String that contains the name of the directory to change to on the remote system. This can be either a fully qualified path or a name relative to the current directory.
Use WebFtpGetCurrentDirectory to determine the remote site's current working directory, instead of assuming that the remote system uses a hierarchical naming scheme for directories. The sDirectory 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. WebFtpSetCurrentDirectory translates the directory name separators to the appropriate character before they are used.

Example

// Set the current directory on the FTP server. 
dcltrans 
  transaction TWebFtpDir 
  var
    hFtp: number; 
  begin
    WebFtpConnect(hFtp, "standardhost", WEB_PORT_FTP, 
                 "anonymous", "mymail@address.com"); 
    WebFtpSetCurrentDirectory(hFtp, "/");
    WebFtpShutdown(hFtp); 
  end TWebFtpDir;

Sample scripts

WebMulti01.bdf

SilkEssential sample

Ftp.sep