Adding metadata (x-amz-meta-SOMEINFO) while uploading to S3

By user3567195

I am looking for a way to programmatically insert custom metadata (x-amz-meta-SOMEINFO) while uploading a file into AWS S3.

Currently I am inserting the file using a Python lambda function into S3 bucket using the below command.

open(‘/tmp/newFile.docx’,
‘wb’).write(attachment.get_payload(decode=True))
s3r.meta.client.upload_file(‘/tmp/newFile.docx’, outputBucket,
attachment.get_filename())

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273