| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Client |
JFTP |
rename |
rename() |
Never | Work in Progress |
This method renames a file or folder on the FTP server.
boolean rename ( $from, $to )
| $from | string | is a string containing the path to change file/folder from. |
| $to | string | is a string containing the path to change file/folder to. |
Example
jimport( 'joomla.connector.ftp' ); $ftp = new JFTP( array( 'type' => FTP_BINARY ) ); $ftp->connect( '127.0.0.1' ); $ftp->login( 'testuser', 'testpass' ); if ($ftp->rename( 'test', 'renametest' ) ) { echo "Rename successful!"; } else { echo "Rename failed!"; }
might produce:
Result
Rename successful!