0
我想上传用户视频文件到Amazon Trough S3 Class,但它给出以下Errors.my密钥和密钥是有效的。 1 = S3 :: putBucket(my_bucket_name,public-read,):[SignatureDoesNotMatch]我们计算的请求签名与您提供的签名不匹配。检查您的密钥和签名方法也是错误是 “上传文件时出现问题...抱歉。” 任何人都知道为什么这是行不通的?上传视频文件到亚马逊通过S3
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (!class_exists('S3'))require_once('S3.php');
if (!defined('awsAccessKey')) define('awsAccessKey', 'xxxxxxxxxxxx');
if (!defined('awsSecretKey')) define('awsSecretKey', 'yyyyyyyyyyyy');
$s3 = new S3(xxxxxxxxx,yyyyyyyyy);
if(isset($_POST['Submit'])){
$fileName = $_FILES['theFile']['name'];
$fileTempName = $_FILES['theFile']['tmp_name'];
$s3->putBucket("hotfit", S3::ACL_PUBLIC_READ,'EU');
if ($s3->putObjectFile($fileTempName, "hotfit", $fileName, S3::ACL_PUBLIC_READ)) {
echo "We successfully uploaded your file.";
}else{
echo "Something went wrong while uploading your file... sorry.";
}
$bucket_contents = $s3->getBucket("hotfit");
foreach ($bucket_contents as $file){
$fname = $file['name'];
$furl = "http://hotfit.s3.amazonaws.com/".$fname;
echo "<a href=\"$furl\">$fname</a><br />";
}
}
?>
<form action="" method="post" enctype="multipart/form-data">
<input name="theFile" type="file" />
<input name="Submit" type="submit" value="Upload">
</form>
我试图这可能是它的工作 – 2012-01-05 07:47:23
u需要做斗来存储用户上传的视频,当用户点击提交并显示所有上传的视频只不过是你没有在foreach循环ü了这一切事情你只需要合成你的代码,以便按照你想要的方式工作 – 2012-01-05 07:52:16
thanx的建议 – 2012-01-05 07:54:25