Changing S3 objects’ metadata in bulk after upload, using boto3

  • fetches all objects in a bucket
  • for each object:
  • fetches the metadata of the file
  • checks the intended content type of a file, based on file extension
  • updates the following in metadata:
  • sets access to ‘public-read’
  • sets ContentDisposition to ‘inline’
  • sets ContentType to the intended content type

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vivek Kaushal

Vivek Kaushal

Hacker | Engineer | Building Enterpret | ex-Samsung, IIIT-H | vivekkaushal.com