Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3798372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:33:42+00:00 2026-05-19T13:33:42+00:00

If you have already uploaded an object to an Amazon S3 bucket, how do

  • 0

If you have already uploaded an object to an Amazon S3 bucket, how do you change the metadata using the API? It is possible to do this in the AWS Management Console, but it is not clear how it could be done programmatically. Specifically, I’m using the boto API in Python and from reading the source it is clear that using key.set_metadata only works before the object is created as it just effects a local dictionary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:33:43+00:00Added an answer on May 19, 2026 at 1:33 pm

    It appears you need to overwrite the object with itself, using a “PUT Object (Copy)” with an x-amz-metadata-directive: REPLACE header in addition to the metadata. In boto, this can be done like this:

    k = k.copy(k.bucket.name, k.name, {'myKey':'myValue'}, preserve_acl=True)
    

    Note that any metadata you do not include in the old dictionary will be dropped. So to preserve old attributes you’ll need to do something like:

    k.metadata.update({'myKey':'myValue'})
    k2 = k.copy(k.bucket.name, k.name, k.metadata, preserve_acl=True)
    k2.metadata = k.metadata    # boto gives back an object without *any* metadata
    k = k2;
    

    I almost missed this solution, which is hinted at in the intro to an incorrectly-titled question that’s actually about a different problem than this question: Change Content-Disposition of existing S3 object

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already searched about this issue, analyzed several open source tools (like Ganymed
I have already googled for this I have a Table with following structure in
I have already posted a question about this, but the situation has changed sufficiently
I have already implemented some AJAX pagination in my Rails app by using the
I have already have this code to force these URLs to HTTPS: RewriteCond %{HTTPS}
I have already uploaded an app with inapp products, it has been accepted and
I am stuck at this point. Scenario is like that - I have already
I am migrating my Java,Tomcat, Mysql server to AWS EC2. I have already attached
I have already posted something similar here but I would like to ask the
I have already tried PreRenderComplete and unload is too late

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.