This function is declared in Wininet.h.
| Parameter | Description |
|---|---|
hConnect |
A handle to an FTP session established by a call to InternetConnect. |
lpszFileName |
A pointer to a null-terminated string that contains the name of the file to be created on the FTP server. |
dwFlags |
Flags that control the behavior of the function. Can be 0 or one or more of the following values:
|
dwAttributes |
Specifies the file attributes for the new file. For a list of possible values, see the dwFlags parameter of the CreateFile function. This parameter is optional and can be set to FILE_ATTRIBUTE_NORMAL if no specific attributes are required. |
dwAccess |
Access to the file. This parameter can be GENERIC_WRITE. |
lpvReserved |
This parameter is reserved and must be NULL. |
dwContext |
The application-defined context value with which the Internet functions associate this request. This parameter is used to return asynchronous data to the application. |
Returns a valid handle to the created file if successful, or NULL otherwise. To get a specific error message, call GetLastError.
The FtpCreateFileW function creates a file on an FTP server. The function returns a handle to the created file. You can then use this handle to write data to the file using functions like InternetWriteFile. When you are finished with the file, close the handle by calling InternetCloseHandle.
The dwFlags parameter determines the transfer type. If dwFlags is 0, the transfer type is automatically determined by the server.
The dwAttributes parameter can be used to specify file attributes, such as whether the file is compressed or hidden. If no specific attributes are required, set this parameter to FILE_ATTRIBUTE_NORMAL.
dwCreationDisposition parameter in a lower-level file operation if your FTP protocol supports it.
| Description | |
|---|---|
| Minimum supported client | Windows XP with SP2, Windows Vista or Windows 7. |
| Minimum supported server | Windows Server 2003 with SP1, Windows Server 2008 or Windows Server 2008 R2. |
| Header | wininet.h |
| Library | wininet.lib |
| DLL | wininet.dll |
| Unicode and ANSI names | FtpCreateFileW (Unicode) and FtpCreateFileA (ANSI). |