This function renames an existing file on the FTP server.
Parameters
Name | Explanation |
---|---|
hConnect | The session handle retrieved from the IKFTPConnect function |
OldFile | The old name of the file (The name and path of the file prior to renaming) |
NewFile | The new name of the file (DOES NOT INCLUDE PATH) |
Return Value
Returns True (nonzero) if successful. Returns False (0) if unsuccessful.
Explanation
The IKFTPRenameFile function renames an existing file on 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.
Example Code:
(1)C++Builder/Visual C++
HINTERNET hOpen, hConnect;
if (IKFTPConnect("www.newtone.co.jp", "User", "Password",
&hOpen, &hConnect) == FALSE) return;
IKFTPRenameFileEx(hConnect, "images/001.jpg", "002.jpg");
IKFTPDisconnect(hOpen, hConnect);
(2)Delphi
hOpen, hConnect: HINTERNET;
if (IKFTPConnect('www.newtone.co.jp', 'User', 'Password', @hOpen,
@hConnect) = False) then Exit;
IKFTPRenameFileEx(hConnect, 'images/001.jpg', '002.jpg');
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 IKFTPRenameFileEx(hConnect, "images/001.jpg", '002.jpg')
Call IKFTPDisconnect(hOpen, hConnect)