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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:00:32+00:00 2026-06-09T07:00:32+00:00

I am using the PHP version of Amazon’s AWS SDK. I have a bunch

  • 0

I am using the PHP version of Amazon’s AWS SDK. I have a bunch of files with an Expires header; I want to delete that header and add a Cache-control header instead. The update_object function lets me add headers but not remove them.

The answers on this question suggest you can update a file’s metadata when you copy it, but I have tried it and it doesn’t work. Here is what I used:

$response = $s3->copy_object(
    array(
        'bucket' => $bucket,
        'filename' => $file,
    ),
    array(
        'bucket' => $bucket,
        'filename' => $file2,
    ),
    array(
        'acl' => AmazonS3::ACL_PUBLIC,
        'headers' => array(
            'Content-Type' => 'image/jpeg',
            'Cache-Control' => 'public,max-age=30240000',
        ),
        'meta' => array(
            'x-fake-header' => 'something awesome is happening',
        ),
    )
);

However, the copied object has the exact same headers as the original object (Expires and Content-Type only). I’ve tried all manner of combinations of the above (with and without Content-Type, Cache-control, meta, etc) and get the same result.

How do I reset the metadata?

  • 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-06-09T07:00:33+00:00Added an answer on June 9, 2026 at 7:00 am

    I’ve just found that copying to object to itself actually does change the headers properly. I was copying it to a second file for testing purposes to avoid overwriting the original.

    But for some strange reason copying to a different file doesn’t change the headers, but copying to the same file does.

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

Sidebar

Related Questions

I am using less php and want to implement an uncompiled version of the
I'm using XAMPP (latest version) on OS 10.6.2, that's bundled with PHP 5.3.0 I
I'm using PHP Version 5.1.6 I have a string (session file) and need to
I am using PHP Version 5.2.5. I want to be able to compare my
I have a news feed that has been developed using PHP, MySQL, and jQuery.
I have a problem searching through amazon web servise using PHP in my CodeIgniter.
I'd like to implement a multiselect function using jqGridRender (the php only version of
I'm using two different version of php on two different OS's. One is 5.2.9
We're using the Mantis bugtracker (version 1.1.8), which is based on PHP. To ease
I am tryign to send email using xampplite version 1.7.7. I changed my PHP.ini

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.