This function transfers a file to the FTP server.
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
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);