Flash Media Server |
|||
| Server-Side ActionScript Language Reference > Server-Side ActionScript Language Reference > File class > File.copyTo() | |||
Flash Media Server 2.
fileObject.copyTo(name)
name Specifies the name of the destination file. The name can contain only UTF-8 characters; high byte values can be encoded using the URI character-encoding scheme. The name specified is mapped to a system path using the mappings specified in the Application.xml file. If the path is invalid or the destination file doesn't exist, the operation fails, and the method returns false.
A Boolean value indicating whether the file as copied successfully (true) or not (false).
Method; copies a file to a different location or copies it to the same location with a different file name. The method returns false if the source file doesn't exist or if the source file is a directory.
The following code copies the file set by myFileObj file object to the location provided by the parameter:
if (myFileObj.copyTo( "/logs/backup/hello.log")){
// Do something here.
}