====== move ====== {#JAPI Joomla.Framework FileSystem JFile::move #} Moves a file. If the current user has permission and safe mode is turned off, then this function will use the PHP [[http://www.php.net/rename|rename]] function. Otherwise, the function will use FTP (if enabled) to move the file. The function returns true if the file was successfully moved. Otherwise, the function returns false and may raise a warning using the [[references:joomla.framework:utilities:JError|JError]] class. ===== Syntax ===== boolean move ( **$src**, **$dest**, **$path** ) | **$src** | string | is a string containing the path to the source file. | | **$dest** | string | is a string containing the path to the destination file. | | **$path** | string | is an optional string containing a base path to prefix to the file names. | ===== Examples ===== Example: This example moves a file. if (JFile::move( 'clock.jpg', 'clock_moved.jpg', 'images/stories/' )) { echo "

File Successfully Moved

"; } else { echo "

Could not move file

"; }
---- ~~DISCUSSION~~