0

i have uploaded thousands of images to amazon s3 and i need to change their content type to be image. i know that i should do it when i try to putObject

$this->s3->putObject(array(
        'Bucket' => $this->s3_bucket,
        'Key' => $file_name,
        'Body' => file_get_contents($tmp_name),
        'ACL' => 'private', 
        'ContentType' => 'image/jpeg'
    ));

but i need to do so for all files that have been uploaded before. thanks

1 Answers1

0

Here is S3Object API:

http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#copy_to-instance_method

Use the copy_to method。

Put content_type in "Options Hash", tested ok in Ruby.

brookz
  • 477
  • 5
  • 17