The ASP Copy Method is used to copying one specified file or folder from one place to another place. The overwrite attribute can be specified to prevent or allow the overwriting of files during the copy operation.
For File Object:
For Folder Object:
Parameters: This method has two parameters as mentioned above and discussed below:
- destination: It specifies the destination path where the file or folder would be copied to. This does allow wildcard characters. This is a required parameter.
- overwrite: It contains a boolean value that indicates whether an existing file or folder can be overwritten or not. The default value is true This is an optional parameter.
The below examples demonstrate the ASP Copy Method.
Example 1: The below code demonstrates the ASP File.Copy Method.
Original File Content: This is a GeeksforGeeks example File is Copied! Copied File Content: This is a GeeksforGeeks example
Example 2: The below code demonstrates the ASP Folder.Copy Method.
Folder is Copied! Folder successfully accessed