0
我需要將資源從網站複製到我的s3存儲桶。例如像這樣的圖像'http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png'我需要將其複製到我的s3桶中的文件夾中。這可能使用Zend_Service_Amazon嗎?如何將文件從網站複製到亞馬遜桶使用zend服務亞馬遜?
我需要將資源從網站複製到我的s3存儲桶。例如像這樣的圖像'http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png'我需要將其複製到我的s3桶中的文件夾中。這可能使用Zend_Service_Amazon嗎?如何將文件從網站複製到亞馬遜桶使用zend服務亞馬遜?
你必須使用流包裝。 我沒有處理圖像文件,但希望它能工作。
$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);
是的可能。 – Samy 2013-03-26 12:30:27