我需要将资源从网站复制到我的s3-bucket。例如,像“http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png”这样的图像,我需要将其复制到s3-bucket中的文件夹中。这可以使用Zend_Service_Amazon实现吗?
发布于 2013-03-26 20:43:50
你必须使用流包装器。我还没有处理图像文件,但希望它能工作。
$s3 = new Zend_Service_Amazon_S3($my_aws_key, $my_aws_secret_key);
$s5="s".rand();
$s3->registerStreamWrapper($s5);
//$bucketname- your bucket name
mkdir($s5."://".$bucketname);
//$path - where you want to store your file including bucketname
$s1=$s5."://".$path;
$filedata = file_get_contents('yourimage url');
file_put_contents($s1, $fildata);https://stackoverflow.com/questions/15633996
复制相似问题