Name:
interface
Value:
Extend your Amplify Gen 2 app with AWS Blocks — self-contained backend capabilities you compose into your existing backend.

Page updated May 21, 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 →
JavaScript v5Amplify JavaScript v5 has entered maintenance mode. We recommend upgrading to v6. A migration guide is available to help you upgrade from v5 to v6.

Get file properties

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

async function getFileProperties() {
try {
const result = await Storage.getProperties('key');
console.log('File Properties ', result);
} catch (error) {
console.log('Error ', error);
}
}

The format of the response will look similar to the below example

{
contentType: "image/jpeg",
contentLength: 6873,
eTag: "\"56b32cf4779ff6ca3ba3f2d455fa56a7\"",
lastModified: Wed Apr 19 2023 14:20:55 GMT-0700 (Pacific Daylight Time) {},
metadata: { owner : 'aws'}
}