So, you can create a new Omeka_Storage_Adapter_ZendS3 object yourself in
code, set whatever parameters you want, and set that as the current
adapter with Omeka_Storage's setAdapter().
In short, you don't need to edit the INI file if you don't want to.
$header = array()array_push($header, 'x-amz-auto-make-bucket:1');array_push($header, 'x-archive-queue-derive:1');array_push($header, 'authorization: LOW '.get_option('access_key').':'.get_option('secret_key'));array_push($headerForPut, 'content-type: '.$fileToBePut->getMimeType());array_push($headerForPut, 'content-length: '.$fileToBePut->size);
curl_setopt($cURL, CURLINFO_CONTENT_LENGTH_UPLOAD, $fileToBePut->size);curl_setopt($cURL, CURLOPT_READFUNCTION, array(&$this, 'stream_function'));curl_setopt($cURL, CURLOPT_UPLOAD, 1);
curl_setopt($cURL, CURLOPT_PUT, 1);
curl_setopt($cURL, CURLOPT_INFILE, fopen($file_uri,'r'));
curl_setopt($cURL, CURLOPT_INFILESIZE, $fileToBePut->size);
--
You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
To post to this group, send email to omek...@googlegroups.com.
To unsubscribe from this group, send email to omeka-dev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/omeka-dev?hl=en.
If you just want to use the S3 API, it'd be better to use the Zend
Framework component Zend_Service_Amazon_S3.
-John
On 03/19/2012 02:37 PM, Daniel wrote:
> Sorry, can I use the built-in S3 class transfer a file from the Omeka
> server
> to an S3-like API? I may have just not entered the right headers.
>
> On Mar 19, 11:34 am, Daniel Vizzini<dvizz...@gmail.com> wrote:
>> Also, I tried constructing an Omeka_Storage_Adapter_ZendS3 instance as follows:
>>
>> $adaptor->move(file_download_uri($file), 'http://s3.us.archive.org/'.'ks_beam_me_up_test_bucket_three');
>>
>> where I defined the error as follows:
>>
>> $adaptor = new Omeka_Storage_Adapter_ZendS3(array(Omeka_Storage_Adapter_ZendS3::AWS_KEY_OP TION
>> => get_option('access_key'),
>> Omeka_Storage_Adapter_ZendS3::AWS_SECRET_KEY_OPTION =>
>> get_option('secret_key'),Omeka_Storage_Adapter_ZendS3::BUCKET_OPTION
>> => 'ks_beam_me_up_test_bucket_three'));
>>
>> I got the following error;
>>
>> Omeka_Storage_Exception: Unable to move file
>>
>> Can I use the built-in S3 class transfer a file from the Omeka server
>> to an S3-like header? I may have just not entered the right headers.
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Mar 19, 2012 at 8:53 AM, Daniel Vizzini<dvizz...@gmail.com> wrote:
>>
>>> I am designing this all for a plug-in, by the way, in the after_save_item hook.
>>
>>>>> To unsubscribe from this group, send email to omeka-dev+...@googlegroups.com.