2013-03-26 187 views

回答

1

你必须使用流包装。 我没有处理图像文件,但希望它能工作。

 $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);