# Function Reference

# _FTP_Open

Opens an FTP session

#include <FTPEx.au3>
_FTP_Open ( $sAgent [, $iAccessType = $INTERNET_OPEN_TYPE_DIRECT [, $sProxyName = '' [, $sProxyBypass = '' [, $iFlags = 0]]]] )

## Parameters

$sAgent | Random name. ( like "myftp" )
$iAccessType | [optional] Set if proxy is used: $INTERNET_OPEN_TYPE_DIRECT (1) -> no proxy (Default) $INTERNET_OPEN_TYPE_PRECONFIG (0)-> Retrieves the proxy or direct configuration from the registry. $INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY (4) -> Retrieves the proxy or direct configuration from the registry and prevents the use of a startup Microsoft JScript or Internet Setup (INS) file. $INTERNET_OPEN_TYPE_PROXY (3)-> Passes requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy. Then no proxy is used.
$sProxyName | [optional] ProxyName.
$sProxyBypass | [optional] ProxyByPasses's.
$iFlags | [optional] $INTERNET_FLAG_ASYNC (0x10000000) -> Makes only asynchronous requests on handles descended from the handle returned from this function. $INTERNET_FLAG_FROM_CACHE (0x01000000)-> Does not make network requests. All entities are returned from the cache. If the requested item is not in the cache, a suitable error, such as ERROR_FILE_NOT_FOUND, is returned.

## Return Value

Success: | a handle to internet session to be used in _FTP_Connect().
Failure: | 0 and sets the @error flag to non-zero.

## Related

_FTP_Close, _FTP_Connect, _FTP_SetStatusCallback

## See Also

Search InternetOpen in MSDN Library.

## Example

    #include <FTPEx.au3>

    Local $hOpen = _FTP_Open('MyFTP Control')
    ; ...
    Local $iFtpc = _FTP_Close($hOpen)