You are currently browsing legacy 3.5 version of documentation. Click here to switch to the newest 5.1 version.
CopyAsync is used to copy the file.
Task CopyAsync(string sourceName, string targetName, Etag etag = null);
|sourceName||string||The full path of the file that you want to copy from|
|targetName||string||The name of the new file you want to copy to|
|etag||Etag||The current file etag used for concurrency checks (
|Task||A task that represents the asynchronous copy operation|
await store .AsyncFilesCommands .CopyAsync( "/movies/intro.avi", "/movies/copies/intro.avi" );
Note that with file copy operation you can change the name of the file too:
await store .AsyncFilesCommands .CopyAsync( "/movies/intro.avi", "/movies/copies/newCopyFile.avi" );