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

LegacyYou are viewing Gen 1 documentation. 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);
}
}