Commands: CopyAsync
CopyAsync is used to copy the file.
Syntax
Task CopyAsync(string sourceName, string targetName, Etag etag = null);
Parameters | ||
---|---|---|
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 (null skips check) |
Return Value | |
---|---|
Task | A task that represents the asynchronous copy operation |
Example
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"
);