FtpCommand

The FtpCommand function issues an arbitrary FTP command to the FTP server.

Syntax

INTERNETAPI BOOL WINAPI FtpCommand(HINTERNET hFtpConnect, BOOL fExpectResponse, DWORD dwFlags, LPCTSTR lpszCommand, DWORD dwContext);

At a Glance

Header file: Wininet.h
Module: Wininet
Platforms: Palm-size PC
Windows CE versions: 2.0 and later

Parameters

hFtpConnect
A valid handle for an FTP session.
fExpectResponse
Boolean flag indicating whether a data response is expected. If fExpectResponse is TRUE, a data response is expected, and the application can call InternetReadFile to read the response.
DwFlag
Conditions under which the data connection takes place. The following flags can be set:
FTP_TRANSFER_TYPE_ASCII
Data connection using FTP's ASCII (Type A) transfer method. Control and formatting information is converted to local equivalents.
FTP_TRANSFER_TYPE_BINARY
Data connection using FTP's Image (Type I) transfer method. The file is transferred exactly as it exists with no changes. This is the default transfer method.
LpszCommand
A string holding an FTP command. For example, "PWD \r\n".
dwContext
An application-defined value that associates the FTP command in a status callback.

Remarks

The dwContext parameter allows for status callbacks to the application, but all requests are handled synchronously.