# Function Reference

# _FTP_Command

Sends a command to an FTP server

#include <FTPEx.au3>
_FTP_Command ( $hFTPSession, $sFTPCommand [, $iFlags = $FTP_TRANSFER_TYPE_ASCII [, $iExpectResponse = 0 [, $iContext = 0]]] )

## Parameters

$hFTPSession | as returned by _FTP_Connect()
$sFTPCommand | Command string to send to FTP Server
$iFlags | [optional] $FTP_TRANSFER_TYPE_ASCII (1) or $FTP_TRANSFER_TYPE_BINARY (2)
$iExpectResponse | [optional] Data socket for response in Async mode. See remarks.
$iContext | [optional] A variable that contains the application-defined value that associates this search with any application data. This is only used if the application has already called _FTP_SetStatusCallback() to set up a status callback function.

## Return Value

Success: | an identifier.
Failure: | 0 and sets the @error flag to non-zero.

## Remarks

Command Examples: depends on server syntax/
The following is for Binary transfer, ASCII transfer, Passive transfer mode (used with firewalls) 'type I' 'type A' 'pasv'
If $iExpectResponse is set to True, a pointer to a handle that is created if a valid data socket is opened is returned in @extended.

## Related

_FTP_Connect, _FTP_SetStatusCallback

## See Also

Search FtpCommand in MSDN Library.