I'm using the PHP SDK 2 for Amazon S3, in particular the UploadBuilder class to do multipart concurrent uploading of files. How, if you can, do you set the storage class of the file that you are uploading? When you do a regular putObject, you can set the storage class that you want the file to have. I want my files to be stored using reduced redundancy rather than the standard storage. Can I just use setOption to set a header like so?
setOption('x-amz-storage-class', 'REDUCED_REDUNDANCY')
From looking at the source of UploadBuilder it appears you may be able to set it using Metadata. Here's an example of setting an MD5 header from the source:
// If an MD5 is specified, then add it to the custom headers of the request
// so that it will be returned when downloading the object from Amazon S3
if ($this->md5) {
$params['Metadata']['x-amz-Content-MD5'] = $this->md5;
}
So, that would mean I would set it doing something like this:
setOption('Metadata', array('x-amz-storage-class' => 'REDUCED_REDUNDANCY'))
Can anyone confirm this is correct or am I way off base?