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 7643507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:28:02+00:00 2026-05-31T09:28:02+00:00

When including the header options to copy_object, the headers DO NOT get updated. Headers

  • 0

When including the header options to copy_object, the headers DO NOT get updated.

Headers don’t get updated until I make a separate call using update_object. I hope I’m doing something wrong, but I’ve tested this 4-5 different ways even getting into the sdk code to poke around.

Is this a bug?

I’m using the latest 1.4.3 SDK

Here is my call:

$amazonS3->copy_object( 
    array( //Source
      'bucket' => SOURCE_BUCKET,
      'filename' => $source_file
    ),
    array( //Target
      'bucket' => VIDEO_BUCKET,
      'filename' => $dest_file,
    ),
    array( //Options
      'acl' => AmazonS3::ACL_PRIVATE,
      'headers' => array(
        'Content-Type' => 'application/octet-stream',
        'Content-Disposition' => 'attachment'
    )
);
  • 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-31T09:28:04+00:00Added an answer on May 31, 2026 at 9:28 am

    I had this problem myself and solved it iamdev. After about a half-day of going insane, I started looking at the actual API rather than just trying to use it.

    In sdk.class.php, on line 1690, you’ll see the following:

     if (isset($opt['metadataDirective']))
     $opt['headers']['x-amz-metadata-directive'] = $opt['metadataDirective'];
     unset($opt['metadataDirective']);
     }
    

    This means if you are not copying an object to itself, it will not replace the key, hence not update it.

    What worked for me was explicitly setting the metadataDirective in my opts in my call, so:

     $amazonS3->copy_object( 
         array( //Source
         'bucket' => SOURCE_BUCKET,
         'filename' => $source_file
     ),
     array( //Target
          'bucket' => VIDEO_BUCKET,
          'filename' => $dest_file,
     ), 
     array( //Options
          'acl' => AmazonS3::ACL_PRIVATE,
          'headers' => array(
          'Content-Type' => 'application/octet-stream',
          'Content-Disposition' => 'attachment'
     ),
     'metadataDirective' => 'REPLACE',
     );
    

    Hope this works for you, although this is an old post and you’ve probably found a workaround.

    Best,
    HG

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

Sidebar

Related Questions

I've checked lots of tutorials about including header, navigation and footer using php include.
Concerning headers in a library, I see two options, and I'm not sure if
How to add column on all rows (including header row) using jQuery. The added
How can I view the full request headers, including post data , using libcurl
When including a header file in C++, what's the difference between... including the .h
Update: What are the effects of including stdafx.h in my header files? I started
I have a question regarding best-practice when including headers. Obviously include guards protect us
when including libraries c, the line does not end with a semicolon, while other
Does anyone have a recommended way to find definitions in header files when using
I am trying to compose a SOAP message(including header) in C# .NET to send

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.