Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated May 1, 2024

Maintenance ModeYou are viewing Amplify Gen 1 documentation. Amplify Gen 1 has entered maintenance mode and will reach end of life on May 1, 2027. New project should use Amplify Gen 2. For existing Gen 1 projects, a migration guide and tooling are available to help you upgrade. Switch to the latest Gen 2 docs →

Copy files

You can copy an existing file to a different location in your S3 bucket. User who initiates a copy operation should have read permission on the copy source file.

Future<void> copy() async {
try {
final result = await Amplify.Storage.copy(
source: const StoragePath.fromString('album/2024/1.jpg'),
destination: const StoragePath.fromString('shared/2024/1.jpg'),
).result;
safePrint('Copied file: ${result.copiedItem.path}');
} on StorageException catch (e) {
safePrint(e);
}
}