This function retrieves a file from the FTP server.

[C++Builder/Visual C++]     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;
[Visual Basic]   Function IKFTPGetFileEx(ByVal hConnect As Long, ByVal RemoteFile As String, ByVal LocalFile As String, ByVal TransPercent As Long, ByVal UserProc As Long) As Long

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/Visual C++
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);

(3)Visual Basic
Dim hOpen As Long
Dim hConnect As Long
If IKFTPConnect("www.newtone.co.jp", "User", "Password", hOpen, hConnect) = False Then Exit Sub
Call IKFTPGetFileEx(hConnect, "images/001.jpg", 'C:\Images\001.jpg', 10, 0)
Call IKFTPDisconnect(hOpen, hConnect)

 

The ImageKit10 ActiveX is a product created by Newtone Corporation