====== copy ====== {#JAPI Joomla.Framework FileSystem JFile::copy #} Copies 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/copy|copy]] function. Otherwise, the function will use FTP (if enabled) to copy the file. The function returns true if the file was successfully copied. Otherwise, the function returns false and may raise a warning using the JError class. ===== Syntax ===== boolean copy ( **$src**, **$dest**, **$path** ) | **$src** | string | is a string that contains the path to the source file. | | **$dest** | string | is a string that contains the path to the destination file. | | **$path** | string | is an optional string that contains a base path to prefix to the file names. | ===== Examples ===== Example: This example copies a file. if (JFile::copy( 'clock.jpg', 'clock_copy.jpg', 'images/stories/' )) { echo "

File Successfully Copied

"; } else { echo "

Could not copy file

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