Object metadata is information about a file held in S3 compatible object storage. It lets you check file size, content type, ETag, last-modified time and other properties without downloading the entire file.
You can get these properties using the AWS CLI and the HeadObject API operation in Cyberin S3 Object Storage.
Run the following command:
aws s3api head-object \
--bucket YOUR_SPACE_NAME \
--key path/to/your-file.pdf \
--endpoint-url https://YOUR_REGION.digitaloceanspaces.comReplace YOUR_SPACE_NAME with your Space name, path/to/your-file.pdf with the actual object key, and YOUR_REGION with your Space's region, such as sgp1.
The command returns the object's available metadata without downloading its contents.
Review the command output for the following fields:
Property | What it tells you |
|---|---|
| File size in bytes. |
| The file's declared MIME type, such as |
| An identifier associated with the stored object representation. |
| The date and time the object was last modified. |
| Custom metadata associated with the object, if present. |
| The configured content disposition, which can influence whether a browser displays or downloads the file. |
For example, a ContentLength value of 204800 means the file is 200 KiB.
Note: An ETag is not always the MD5 checksum of the complete file, particularly for multipart uploads. Use an appropriate checksum when you need to verify file integrity.
If a file opens in the browser instead of downloading, inspect the ContentType and ContentDisposition fields.
ContentType identifies the type of content being served.
ContentDisposition can specify attachment to encourage the browser to download the file.
If either property needs to change, update the object's metadata using an appropriate upload or copy operation. The head-object command only retrieves metadata; it does not modify it.