Share via


FtpCommand

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function issues an arbitrary FTP command to the FTP server.

Syntax

BOOL WINAPI FtpCommand(
  HINTERNET hConnect, 
  BOOL fExpectResponse, 
  DWORD dwFlags, 
  LPCTSTR lpszCommand, 
  DWORD dwContext
  HINTERNET* phFtpCommand
);

Parameters

  • hConnect
    [in] Valid handle for an FTP session.
  • fExpectResponse
    [in] Boolean that specifies if a data response is expected. If fExpectResponse is TRUE, a data response is expected, and the application can call the InternetReadFile function to read the response.
  • dwFlags
    [in] Specifies the conditions under which the data connection takes place. The following table shows the flags that can be set.

    Value Description

    FTP_TRANSFER_TYPE_ASCII

    Data connection using the FTP ASCII, Type A, transfer method. Control and formatting data is converted to local equivalents.

    FTP_TRANSFER_TYPE_BINARY

    Data connection using the FTP Image, Type I, transfer method. The file is transferred exactly as it exists with no changes. This is the default transfer method.

  • lpszCommand
    [in] Long pointer to the null-terminated string that contains an FTP command, for example, "PWD \r\n".
  • dwContext
    [in] Specifies an application-defined value that associates the FTP command in a status callback.
  • phFtpCommand
    [out] A pointer to a handle that is created if a valid data socket is opened. The fExpectResponse parameter must be set to TRUE for phFtpCommand to be filled.

Remarks

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

Requirements

Header wininet.h
Library wininet.lib
Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

InternetReadFile
WinInet Functions