psugand / CodeIgniter-S3

Amazon S3 Library for CodeIgniter
http://prashant.es
241 stars 115 forks source link

REDUCED_REDUNDANCY #9

Closed mbarwick83 closed 10 years ago

mbarwick83 commented 10 years ago

How can we set REDUCED_REDUNDANCY on the file uploads? Can't get it to work with your code...

daverogers commented 10 years ago

Yeah, looking at the code, probably because of this:

$rest->setAmzHeader('x-amz-acl', $acl);
foreach ($metaHeaders as $h => $v)
    $rest->setAmzHeader('x-amz-meta-' . $h, $v);

(lines 397 - 399)

Amazon's REST API expects "x-amz-storage-class: REDUCED_REDUNDANCY" but the above code is creating "x-amz-meta-storage-class" if you tried to add it to $metaHeaders. I'll add a line like the ACL code specific to storage class, with standard being default.