How To: Set and Retrieve Metadata of an S3 Object

published 14.01.2020 17:59

by {{Node.Authors[0].Realname }} from dzone.com
Image of article 'How To: Set and Retrieve Metadata of an S3 Object'

In the article, we will see how to upload the metadata of an object while uploading it to S3 programmatically with Node.js.

The following code helps you to upload an object to s3, along with its metadata.

The following code helps you to retrieve the metadata of an object uploaded to an s3.

Within the PUT request header, the user-defined metadata is limited to 2 KB in size.

The size of user-defined metadata is measured by taking the sum of the number of bytes in the UTF-8 encoding of each key and value.