|
SmartFTP FTP Library
|
import "sfFTPLib.idl";
Public Member Functions | |
| HRESULT | EvaluateParserFormat ([out, retval] ParserFormat *retval) |
| HRESULT | GetCaseSensitivity ([out, retval] CaseSensitivity *retval) |
| Determines if the remote file system distinguishes between uppercase and lowercase filenames. | |
| HRESULT | GetServerCapabilityState ([in] ServerCapability capability, [out, retval] ServerCapabilityState *retval) |
| HRESULT | IsHashAlgoAvailable ([in] HashAlgo algo, [out, retval] VARIANT_BOOL *retval) |
| Checks if the server supports a specific hashing algorithm. | |
| HRESULT | LookupFeature ([in] BSTR key, [out] BSTR *value, [out, retval] VARIANT_BOOL *retval) |
| Checks if a specific server feature is supported and retrieves its parameters. | |
Properties | |
| long | CodePage [get] |
| Retrieves the Windows Code Page identifier used for filename encoding. | |
| DataProtection | DataProtection [get] |
| Retrieves the current security level of the data channel. | |
| DataProtection | CommandProtection [get] |
| Retrieves the security level of the Control (Command) channel. | |
| DataTransferType | DataTransferType [get] |
| Retrieves the currently active data transfer mode. | |
| DataTransferMode | DataTransferMode [get] |
| Retrieves the currently active data transfer mode (Stream, Block, or Compressed). | |
| ServerType | ServerType [get] |
| Retrieves the identified type or operating system of the remote server. | |
| ServerSoftware | ServerSoftware [get] |
| Retrieves the specific server software family detected by the component. | |
| VARIANT_BOOL | PBSZ [get] |
| Indicates whether the Protection Buffer Size (PBSZ) has been successfully negotiated. | |
| VARIANT_BOOL | SSCN [get] |
| Retrieves the status of the Set Secure Connection Negotiation (SSCN) mode. | |
| BSTR | WorkingDirectory [get] |
| Retrieves the current remote working directory. | |
| BSTR | HomeDirectory [get] |
| Retrieves the initial login directory for the user. | |
| BSTR | SYSTReply [get] |
| Retrieves the server's response to the SYST command. | |
| BSTR | FEATReply [get] |
| Retrieves the raw server response to the FEAT command. | |
| BSTR | WelcomeMessage [get] |
| Retrieves the initial greeting message sent by the server. | |
| IFTPServerId | ServerId [get] |
| Retrieves the server identification details obtained via the CSID command. | |
| OperatingSystem | OperatingSystem [get] |
| Retrieves the detected operating system family of the remote server. | |
| HRESULT IFTPServerState::EvaluateParserFormat | ( | [out, retval] ParserFormat * | retval | ) |
| HRESULT IFTPServerState::GetCaseSensitivity | ( | [out, retval] CaseSensitivity * | retval | ) |
Determines if the remote file system distinguishes between uppercase and lowercase filenames.
This method retrieves the case sensitivity setting of the connected server, which dictates how file lookups and equality checks are performed.
Mechanism: The library infers this setting primarily from the server's response to the SYST (System Type) command:
| [out] | retval | Pointer to a CaseSensitivity enum receiving the status. |
| HRESULT IFTPServerState::GetServerCapabilityState | ( | [in] ServerCapability | capability, |
| [out, retval] ServerCapabilityState * | retval ) |
| HRESULT IFTPServerState::IsHashAlgoAvailable | ( | [in] HashAlgo | algo, |
| [out, retval] VARIANT_BOOL * | retval ) |
Checks if the server supports a specific hashing algorithm.
This method determines whether the connected FTP server implements the requested hash algorithm (e.g., CRC32, MD5, SHA-1).
This information is usually derived from the server's response to the FEAT command (specifically the HASH feature negotiation) or by detecting support for legacy commands like XCRC, XMD5, or XSHA1.
| [in] | algo | The HashAlgo enumeration value to check. |
| [out] | retval | Pointer to a VARIANT_BOOL indicating the result:
|
| HRESULT IFTPServerState::LookupFeature | ( | [in] BSTR | key, |
| [out] BSTR * | value, | ||
| [out, retval] VARIANT_BOOL * | retval ) |
Checks if a specific server feature is supported and retrieves its parameters.
This method queries the internal map of features populated by the server's response to the FEAT command (RFC 2389).
Key vs. Value:
| [in] | key | The name of the feature to look up (case-insensitive). |
| [out] | value | Pointer to a BSTR that receives the feature's parameter string (if any).
|
| [out] | retval | Pointer to a VARIANT_BOOL indicating the result:
|
|
getproperty |
Retrieves the Windows Code Page identifier used for filename encoding.
This property represents the character encoding scheme that the library is currently using to interpret file names and server responses.
Why is this important? FTP was originally designed for 7-bit ASCII. Modern servers handle international characters (accents, Kanji, Cyrillic) differently:
If this value does not match the server's actual configuration, file names may appear garbled.
Common Values:
| [out] | retval | Pointer to a long that receives the Code Page ID. |
|
getproperty |
Retrieves the security level of the Control (Command) channel.
This property indicates whether the main connection used to send commands (like USER, PASS, LIST) is currently encrypted.
Significance:
Relationship to Data Protection: It is possible to have an encrypted Command channel (Private) but an unencrypted Data channel (Clear) if the PROT P command has not been issued. However, you generally cannot have an encrypted Data channel if the Command channel is Clear.
| [out] | retval | Pointer to a DataProtection enum that receives the current state. |
|
getproperty |
Retrieves the current security level of the data channel.
This property reflects the active protection level negotiated with the server via the PROT command.
Usage: Check this property before initiating a sensitive file transfer to ensure encryption is active.
Prerequisites: A value of ftpDataProtectionPrivate is only possible if:
| [out] | retval | Pointer to a DataProtection enum that receives the current state. |
|
getproperty |
Retrieves the currently active data transfer mode (Stream, Block, or Compressed).
This property reflects the state established by the last successful MODE command sent to the server. If the server does not support a requested mode (such as Mode Z), this property will show the fallback mode (usually Stream) currently in effect.
| [out] | retval | Pointer to a DataTransferMode enum that receives the current state. |
|
getproperty |
Retrieves the currently active data transfer mode.
This property reflects the last successful TYPE command sent to the server.
| [out] | retval | Pointer to a DataTransferType enum that receives the current state. |
|
getproperty |
Retrieves the raw server response to the FEAT command.
This property contains the complete, unparsed text returned by the server when the library issues the FEAT (Feature Negotiation) command defined in RFC 2389.
Content Format: The string is typically a multi-line list where each line represents a supported extension, such as:
| [out] | retval | Pointer to a BSTR that receives the FEAT reply. |
|
getproperty |
Retrieves the initial login directory for the user.
This property represents the default directory assigned to the user upon successful authentication.
Difference from WorkingDirectory:
| [out] | retval | Pointer to a BSTR that receives the home directory path. |
|
getproperty |
Retrieves the detected operating system family of the remote server.
This property provides a high-level classification of the remote environment. The library uses this information to adapt its internal logic for file system operations.
| [out] | retval | Pointer to an OperatingSystem enum representing the server's OS. |
|
getproperty |
Indicates whether the Protection Buffer Size (PBSZ) has been successfully negotiated.
This property returns TRUE if the client has successfully issued the PBSZ 0 command to the server.
| [out] | retval | Pointer to a VARIANT_BOOL indicating the state:
|
|
getproperty |
Retrieves the server identification details obtained via the CSID command.
The Context: The ServerId property provides a structured way to identify the specific brand and version of the FTP server software. This is populated after the component issues the CSID command (Client System Identification).
**Why use this over ServerType?**
Usage: Use this property when your application needs to apply specific logic or workarounds for certain server vendors.
| [out] | retval | Receives a pointer to the IFTPServerId interface. |
|
getproperty |
Retrieves the specific server software family detected by the component.
The Mechanism: The component attempts to identify the server software using several methods:
| [out] | retval | Receives the ServerSoftware enumeration value. |
|
getproperty |
Retrieves the identified type or operating system of the remote server.
After a successful connection, the component automatically sends the SYST command to the server. This property reflects the result of that identification.
| [out] | retval | Pointer to a ServerType enum that receives the detected server type. |
|
getproperty |
Retrieves the status of the Set Secure Connection Negotiation (SSCN) mode.
This property indicates whether the SSCN mechanism is currently active (On) or inactive (Off) for this session.
What is SSCN? SSCN (Set Secure Connection Negotiation) is a protocol extension used primarily during Secure FXP (Server-to-Server) transfers.
When transferring files directly between two secure FTP servers:
State Interpretation:
| [out] | retval | Pointer to a VARIANT_BOOL indicating the state:
|
|
getproperty |
Retrieves the server's response to the SYST command.
This property contains the raw identification string returned by the server when the library issues the SYST (System Type) command.
This command is typically sent automatically during the post-login sequence to determine the server's operating system environment.
Common Values:
Usage: The library uses this string internally to:
| [out] | retval | Pointer to a BSTR that receives the SYST reply. |
|
getproperty |
Retrieves the initial greeting message sent by the server.
This property contains the raw text received immediately after the TCP connection is established, but before any login credentials are sent.
Usage: Use this property to identify the server software type (fingerprinting) or to display the Message of the Day (MOTD) to the user.
|
getproperty |
Retrieves the current remote working directory.
This property tracks the directory path where the session is currently located on the server.
| [out] | retval | Pointer to a BSTR that receives the current absolute path. |