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 →

Get file properties

You can get file properties and metadata without downloading the file using Amplify.Storage.getProperties.

Future<void> getFileProperties() async {
try {
final result = await Amplify.Storage.getProperties(
path: const StoragePath.fromString('example.txt'),
).result;
safePrint('File size: ${result.storageItem.size}');
} on StorageException catch (e) {
safePrint(e.message);
}
}