This function transfers a file to the FTP server.

[C++Builder/Visual C++]     BOOL IKFTPPutFileEx(HINTERNET hConnect, LPCTSTR RemoteFile, LPCTSTR LocalFile, long TransPercent, IKPROCESSPROC UserProc);
[Delphi]         function IKFTPPutFileEx(hConnect: HINTERNET; RemoteFile, LocalFile: LPCTSTR; TransPercent: Longint; UserProc: LONG_PTR): LongBool;
[Visual Basic]   Function IKFTPPutFileEx(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 destination on the FTP server where the file is to be saved. Includes path and file name
LocalFile The filename and path of the file on the local computer that will be transferred
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 IKFTPPutFileEx function transfers a file to the FTP server. It can be used only after the IKFTPConnect function has successfully connected to the FTP server. This method 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;
IKFTPPutFileEx(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;
IKFTPPutFileEx(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 IKFTPPutFileEx(hConnect, "images/001.jpg", 'C:\Images\001.jpg', 10, 0)
Call IKFTPDisconnect(hOpen, hConnect)

 

The ImageKit10 ActiveX is a product created by Newtone Corporation