Table of Contents

rename

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Client Class JFTP Method rename Reference rename() Never Work in Progress

This method renames a file or folder on the FTP server.

Syntax

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.

Examples

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!