This function retrieves a file from the FTP server.

[C++Builder]   BOOL IKFTPGetFileEx(HINTERNET hConnect, LPCTSTR RemoteFile, LPCTSTR LocalFile, long TransPercent, IKPROCESSPROC UserProc);
[Delphi]   function IKFTPGetFileEx(hConnect: HINTERNET; RemoteFile, LocalFile: LPCTSTR; TransPercent: Longint; UserProc: LONG_PTR): LongBool;

Parameters

Name Explanation
hConnect The session handle retrieved from the IKFTPConnect function
RemoteFile The name and path of the file to be retrieved
LocalFile The name and path on the local computer where the file is saved
TransPercent The percent of file tranferred before the User Function is called
UserProc The address of the user function (If not using the user function then set to 0)

Return Value

Returns True (nonzero) if successful. Returns False (0) if unsuccessful.

Explanation

The IKFTPGetFileEx function retrieves a file from the FTP server. It can be used only after the IKFTPConnect function has successfully connected to the FTP server. This function can only be executed from the client computer. It does not operate on the server. The TransPercent parameter sets the percent of file tranferred before the User Function is called.

Example Code:

(1)C++Builder
HINTERNET hOpen, hConnect;
if (IKFTPConnect("www.newtone.co.jp", "User", "Password", &hOpen, &hConnect) == FALSE) return;
IKFTPGetFileEx(hConnect, "images/001.jpg", "C:\\Images\\001.jpg", 10, 0);
IKFTPDisconnect(hOpen, hConnect);

(2)Delphi
hOpen, hConnect: HINTERNET;
if (IKFTPConnect('www.newtone.co.jp', 'User', 'Password', @hOpen, @hConnect) = False) then Exit;
IKFTPGetFileEx(hConnect, 'images/001.jpg', 'C:\Images\001.jpg', 10, 0);
IKFTPDisconnect(hOpen, hConnect);

 

The ImageKit10 VCL is a product created by Newtone Corporation