DirectoryExistsOnServer

<< Fare clic per visualizzazione il sommario >>

Percorso:  API di piattaforma > Altri servizi > FTP >

DirectoryExistsOnServer

Service

FTP

 

Method

DirectoryExistsOnServer

 

Description

Detects whether a directory exists on the specified FTP server. Not all FTP servers support this.

 

Input

Name

Description

Type

Optional

server

Connection and login information for the server.

 

Download FTPSettings data structure.

Dataset

 

remotePath

Remote directory pathname.

String

 

Output

Name

Description

Type

Optional

returnValue

True if the directory exists, false otherwise.

Bool

 

 

Remarks

The standard FTP protocol does not have a dedicated command that could be used to detect whether a directory exists.

There is the MLST command that is quite reliable, but not all servers support it, so MDTM, SIZE or even PWD, CWD commands are used for these servers.

The server parameter contains the following fields:

"ServerName" (String) -> the server address, either a hostname or a dotted string IP address

"ServerPort" (Int32) -> the server port

"SslMode" (Int32) -> the TLS/SSL security mode (*** ignored for SFtp ***):

o        0 = None (unsecured connection, no TLS/SSL)

o        1 = Implicit (implicitly secured TLS/SSL connection)

o        2 = Explicit (explicitly secured TLS/SSL connection)

"UserName" (String) -> the username; if null, "anonymous" is used

"Password" (String) -> password for the given username; if null, "guest" is used

"Passive" (Boolean) -> the file transfer type; default is true (passive); *** ignored for SFtp ***

o        Passive mode: data transfer connections are made by the client, which connects to the server

               Active mode: data transfer connections are made by the server, which connects to the client

               Firewalls and NATs often make it impossible to use active transfers

o        When using HttpConnect proxy, this property is ignored and all transfers are passive

"ProxyType" (Int32) -> the proxy type:

o        0 = None (direct connection, default when no proxy is specified)

o        1 = Socks4 (connection through Socks4 proxy)

o        2 = Socks4a (connection through Socks4A proxy (capable of resolving domain names))

o        3 = Socks5 (connection through Socks5 proxy)

o        4 = HttpConnect (connection through HTTP proxy using CONNECT method)

o        5 = FtpSite (connection through FTP proxy using SITE command); *** not usable for SFtp ***

o        6 = FtpUser (connection through FTP proxy using USER command); *** not usable for SFtp ***

o        7 = FtpOpen (connection through FTP proxy using OPEN command); *** not usable for SFtp ***

"ProxyHost" (String) -> the hostname of the proxy server

"ProxyPort" (Int32) -> the port of the proxy server

"ProxyUserName" (String) -> a username to submit to the proxy server for authentication

"ProxyPassword" (String) -> a password to submit to the proxy server for authentication

"ProxyAuthenticationMethod" (Int32) -> the type of the proxy server authentication method:

o        0 = Basic (Basic authentication)

o        1 = Ntlm (NTLM authentication)

o        2 = Digest (Digest authentication)

"ProxyBypassProxyOnLocal" (Boolean) -> true to bypass the proxy server for local addresses, otherwise false; the default value is false

"SFtp" (Boolean) -> true to use SFtp instead of Ftp; default is false (Ftp)