我在我的项目开发中使用下面的第三方API
http://undesigned.org.za/2007/10/22/amazon-s3-php-class如何在AmazonS3中创建对象的下载链接?
我做喜欢上传的所有任务,删除,斗列表,对象列表这个API, 但主要的任务来创建对象之一下载链接形成一个桶是朦胧的。
官方亚马逊API有: get_object_url ($bucket, $filename, $preauth, $opt)
得到任何对象的URL,但与上述API是缺乏方法和文档。
其下面的错误与此代码显示当我点击下载链接:
代码
<h1>All uploaded files</h1>
<?php
// Get the contents of our bucket
$contents = $s3->getBucket("mybucket");
foreach ($contents as $file){
$fname = $file['name'];
$furl = "http://mybucket.s3.amazonaws.com/".$fname;
//output a link to the file
echo "<a href=\"$furl\">$fname</a><br />";
}
?>
错误
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>5A23C56B55611736</RequestId>
<HostId>m2V2NlI19zgGPq0o4lXmIfod2BeQZIkuH4Yu651372cE/hfa9BkLdV8y3LlYjtw1</HostId>
</Error>
如果有人有任何想法或经验用这个API然后建议我。谢谢
我已经更新了我的S3类 - '链接:http:// amazon- s3-php-class.googlecode.com/files/s3-php5-curl_0.4.0.tar.gz' – Frank
感谢您的支持,它的完成。 – Frank