1
作品使用curl
,如果我這樣做:上傳到presigned S3 URL正從瀏覽器中的403,但捲曲
curl -v --upload-file tumblr_nl29hydgtP1uq22wlo1_r2_1280.jpg https://s3.amazonaws.com/mybutcket/1_myfile\?AWSAccessKeyId\=mykey\&Expires\=1427991209\&Signature\=DzspMuzu5%2Fpo43PWriJdOZnF2FA%3D
它上傳就好了。然而,當我嘗試在瀏覽器中上傳,我得到這個錯誤
<?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>
<AWSAccessKeyId>mykey</AWSAccessKeyId>
<StringToSign>PUT
multipart/form-data
1427992617
/mybucket/1_myfile</StringToSign>
<SignatureProvided>dEyHSGBGcSmCfsZ1ahPryYTaB0U=</SignatureProvided>
<StringToSignBytes>50 55 54 0a 0a 6d 75 6c 74 69 70 61 72 74 2f 66 6f 72 6d 2d 64 61 74 61 0a 31 34 32 37 39 39 32 36 31 37 0a 2f 6d 6f 6e 65 67 72 61 70 68 2e 64 65 76 2e 75 70 6c 6f 61 64 73 2f 31 5f 6d 79 66 69 6c 65</StringToSignBytes>
<RequestId>F2C56B03E9F27E3F</RequestId>
<HostId>4sC6jReptppcxmE5yb5MvcZ70cB/gC0obCMEZHI+2zC/qqNFtxHd2wU2+niCHBHV</HostId>
</Error>
我Request Headers
連接
您是否比較了字符串,從錯誤響應中將您簽名的字符串*簽名? 'multipart/form-data'在這裏沒有多大意義。 – 2015-04-02 22:03:55