Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileInformation.CopyAsync(IStorageFolder, String, NameCollisionOption) | copyAsync(IStorageFolder, String, NameCollisionOption) method

Applies to Windows only

Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder. The method also specifies what to do if a file with the same name already exists in the specified folder.

Syntax


fileInformation.copyAsync(destinationFolder, desiredNewName, option).done( /* Your success and error handlers */ );

Parameters

destinationFolder

Type: IStorageFolder

The folder in which to store the copied file.

desiredNewName

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The name of the new copy.

option

Type: NameCollisionOption

A value that indicates what to do if the file name already exists in the destination folder.

Return value

Type: IAsyncOperation<StorageFile>

When this method completes successfully, it returns the copy as a StorageFile object.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Storage.BulkAccess
Windows::Storage::BulkAccess [C++]

Metadata

Windows.winmd

See also

FileInformation
CopyAsync(IStorageFolder)
CopyAsync(IStorageFolder, String)

 

 

Show:
© 2014 Microsoft