storeItem() method is used to upload or otherwise add files to
the storage provider.
Example 96. Storing an item
<?php
$data = file_get_contents('/my/local/dir/picture.jpg');
$returnedData = $storage->storeItem('/my/remote/path/picture.jpg', $data);
An optional third parameter describes service-specific options.
Example 97. Storing an item with options
<?php
$data = file_get_contents("/my/local/dir/picture.jpg");
// Use S3 bucket: myBucket
// Make this item publicly readable
$returnedData = $storage->storeItem(
'/my/remote/path/picture.jpg',
$data,
array(
Zend_Cloud_StorageService_Adapter_S3::BUCKET_NAME => "myBucket",
Zend_Cloud_StorageService_Adapter_S3::METADATA => array(
Zend_Service_Amazon_S3::S3_ACL_HEADER => Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ,
)
)
);
For service adapters that support streaming, data can also be a PHP stream (i.e. opened file).




