如果我通過取代舊的參數與新捲曲:
curl -X POST -F "key=700e17c5631a4aa4acbc470dafbc1eb500"
-F "acl=authenticated-read"
-F "success_action_status=201"
-F "policy=eyJleHBpcmF0aW9uIjoiMjAxNS0wOS0zMFQxMjozNToxN1oiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJxYnByb2QifSx7ImFjbCI6ImF1dGhlbnRpY2F0ZWQtcmVhZCJ9LHsiQ29udGVudC1UeXBlIjoiaW1hZ2UvanBlZyJ9LHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjoiMjAxIn0seyJFeHBpcmVzIjoiV2VkLCAzMCBTZXAgMjAxNSAxMjozNToxNyBHTVQifSx7ImtleSI6IjcwMGUxN2M1NjMxYTRhYTRhY2JjNDcwZGFmYmMxZWI1MDAifSx7IngtYW16LWNyZWRlbnRpYWwiOiJBS0lBSVk3S0ZNMjNYR1hKN1I3QS8yMDE1MDkzMC91cy1lYXN0LTEvczMvYXdzNF9yZXF1ZXN0In0seyJ4LWFtei1hbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJ4LWFtei1kYXRlIjoiMjAxNTA5MzBUMTEzNTE3WiJ9XX0="
-F "x-amz-algorithm=AWS4-HMAC-SHA256"
-F "x-amz-credential=AKIAIY7KFM23XGXJ7R7A/20150930/us-east-1/s3/aws4_request"
-F "x-amz-date=20150930T113517Z"
-F "x-amz signature=7627f482b34d4367a0fe94c66d92e4bfd5bb21d52aa10c7d1e0bee79fe10262d"
-F "Content-Type=image/jpeg"
-F "[email protected]" http://qbprod.s3.amazonaws.com/
然後我得到的錯誤:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>Invalid according to Policy: Policy Condition failed: ["eq", "$Expires", "Wed, 30 Sep 2015 12:35:17 GMT"]</Message>
<RequestId>F185E7B81C9E7A93</RequestId>
<HostId>zsexgCQc+v3YzJllJBAcU74GT1vBv1Zthr35jfwU1OFEczb8n545nf5ItT6z1pHGaBZNf0SEwqg=</HostId>
</Error>
,或者這個請求:
curl -X POST -F "[email protected]" "https://qbprod.s3.amazonaws.com/?Content-Type=image%2Fjpeg&Expires=Wed%2C%2030%20Sep%202015%2012%3A51%3A50%20GMT&acl=authenticated-read&key=364ee836073642b1b9e096c56901744800&policy=eyJleHBpcmF0aW9uIjoiMjAxNS0wOS0zMFQxMjo1MTo1MFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJxYnByb2QifSx7ImFjbCI6ImF1dGhlbnRpY2F0ZWQtcmVhZCJ9LHsiQ29udGVudC1UeXBlIjoiaW1hZ2UvanBlZyJ9LHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjoiMjAxIn0seyJFeHBpcmVzIjoiV2VkLCAzMCBTZXAgMjAxNSAxMjo1MTo1MCBHTVQifSx7ImtleSI6IjM2NGVlODM2MDczNjQyYjFiOWUwOTZjNTY5MDE3NDQ4MDAifSx7IngtYW16LWNyZWRlbnRpYWwiOiJBS0lBSVk3S0ZNMjNYR1hKN1I3QS8yMDE1MDkzMC91cy1lYXN0LTEvczMvYXdzNF9yZXF1ZXN0In0seyJ4LWFtei1hbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJ4LWFtei1kYXRlIjoiMjAxNTA5MzBUMTE1MTUwWiJ9XX0%3D&success_action_status=201&x-amz-algorithm=AWS4-HMAC-SHA256&x-amz-credential=AKIAIY7KFM23XGXJ7R7A%2F20150930%2Fus-east-1%2Fs3%2Faws4_request&x-amz-date=20150930T115150Z&x-amz-signature=e7a6bb40314389d2ccaed103cb4e3e5863cdb9ab2e836abeb95f2d37e52adcd4"
我也得到另一個錯誤:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument</Code>
<Message>Conflicting query string parameters: acl, policy</Message> <ArgumentName>ResourceType</ArgumentName> <ArgumentValue>acl</ArgumentValue><RequestId>DE19DF947C9ED08C</RequestId><HostId>uZchgGd79FPhotgy/gyzNIkKPWmV3WIsDpw2q46P4xPM4JVLe0T5/fPYV7UZ2jxb</HostId></Error>
不幸的是,我不能使用這種方法,因爲我們有一個大尺寸的內容,我們需要從文件加載數據,而不是從內存加載數據。 –
我想我應該按照下一個文檔http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html#sigv4-post-example-file-upload?這樣對嗎? –