0
我嘗試了文件上傳到我的Amazon S3闖民宅本教程 http://www.anyexample.com/programming/php/uploading_files_to_amazon_s3_with_rest_api.xmlPHP亞馬遜文件上傳簽名
但我得到了以下錯誤
HTTP/1.1 403 Forbidden
x-amz-request-id: 10F111F91A85CFC5
x-amz-id-2: 6pBJs+OKZOZdTF3zQw0MLM62zGAAsCFyeJsv/xzYB+wM7+7RnZU+k1rtcpTWC8VS
Content-Type: application/xml
Transfer-Encoding: chunked
Date: Fri, 02 Dec 2011 09:35:21 GMT
Server: AmazonS3
2bf
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<StringToSignBytes>50 55 54 0a 0a 0a 46 72 69 2c 20 30 32 20 44 65 63 20 32 30 31 31 20 30 39 3a 33 37 3a 35 30 20 2b 30 30 30 30 0a 2f 74 61 6e 65 77</StringToSignBytes>
<RequestId>10F111F91A85CFC5</RequestId>
<HostId>6pBJs+OKZOZdTF3zQw0MLM62zGAAsCFyeJsv/xzYB+wM7+7RnZU+k1rtcpTWC8VS</HostId>
<SignatureProvided>6V2sLdHEJ9uWZO0G81q5QQzSa9Y=</SignatureProvided><StringToSign>PUT
任何想法 預先感謝
是'我們出的要求籤名不匹配您提供的簽名。檢查你的密鑰和簽名方法.'不清楚了嗎? –
他們以下是簽名方法...你能幫忙嗎? $ dt = gmdate('r'); //基於GMT的時間戳 //準備要簽名的字符串(請參閱AWS S3開發人員指南) $ string2sign =「PUT {$ dt}/{$ aws_bucket}」; //準備HTTP PUT查詢 $查詢=「PUT/{$ aws_bucket} HTTP/1.1 主持人:s3.amazonaws.com 連接:保持活躍 日期:$ DT 授權:AWS {$ aws_key}: 」 .amazon_hmac(string2sign $) 「\ n \ n」; $ RESP = sendREST($ FP,$查詢); 如果(strpos($ RESP, '')==假的!){ 模具($ RESP); } –
ramesh
你有你自己的AWS訪問密鑰ID和祕密訪問鍵? –