BOOL FtpGetFile(
IN HINTERNET hFtpSession,
IN LPCTSTR lpszRemoteFile,
IN LPCTSTR lpszNewFile,
IN BOOL fFailIfExists,
IN DWORD dwFlagsAndAttributes,
IN DWORD dwFlags,
IN DWORD dwContext
);
Retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process.
Returns TRUE if successful, or FALSE otherwise. To get a specific error code, call GetLastError.
hFtpSession
Valid handle to an FTP session.
lpszRemoteFile
Address of a null-terminated string that contains the name of the file to retrieve from the remote system.
lpszNewFile
Address of a null-terminated string that contains the name of the file to create on the local system.
fFailIfExists
Boolean flag that indicates whether the function should proceed if a local file of the specified name already exists. If fFailIfExists is TRUE and the local file exists, FtpGetFile fails.
dwFlagsAndAttributes
File attributes and flags for the new file. Can be any combination of FILE_ATTRIBUTE_* and INTERNET_FLAG_* file attributes. See CreateFile for more information on FILE_ATTRIBUTE_* attributes, and see InternetOpenUrl for more information on INTERNET_FLAG_* flags.
dwFlags
Flag value that indicates the conditions under which the transfer occurs. Can be any of the FTP_TRANSFER_TYPE_* values. For a description of these values, see FtpOpenFile. dwContext
Application-defined value that associates this search with any application data. This is used only if the application has already called InternetSetStatusCallback to set up a status callback function.