{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1078","repository_url":"https://api.github.com/repos/aws/aws-sdk-php","labels_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1078/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1078/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1078/events","html_url":"https://github.com/aws/aws-sdk-php/issues/1078","id":175005501,"number":1078,"title":"Some question about Pre-Signed URL.","user":{"login":"fenying","id":11142903,"avatar_url":"https://avatars.githubusercontent.com/u/11142903?v=3","gravatar_id":"","url":"https://api.github.com/users/fenying","html_url":"https://github.com/fenying","followers_url":"https://api.github.com/users/fenying/followers","following_url":"https://api.github.com/users/fenying/following{/other_user}","gists_url":"https://api.github.com/users/fenying/gists{/gist_id}","starred_url":"https://api.github.com/users/fenying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenying/subscriptions","organizations_url":"https://api.github.com/users/fenying/orgs","repos_url":"https://api.github.com/users/fenying/repos","events_url":"https://api.github.com/users/fenying/events{/privacy}","received_events_url":"https://api.github.com/users/fenying/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-05T06:49:07Z","updated_at":"2016-09-05T08:47:19Z","closed_at":null,"body":"um...My propose is that:\r\n\r\nI used `CreateMultipartUpload` and got the UploadId for AWS S3. Then I generated some multipart upload Pre-signed URL and gave them to a client for upload.\r\n\r\nHere is the question, the URLs for `UploadPart` work fine, but the pre-signed URL for `CompleteMultipartUpload` doesn't work.\r\n\r\nThis is how I generates the URL for `CompleteMultipartUpload`.\r\n\r\n```php\r\npublic static function getCompleteMultipartUploadURL($file, $uploadID, $expires) {\r\n\r\n    $client = self::getS3Client();\r\n\r\n    $cmd = $client->getCommand('CompleteMultipartUpload', [\r\n\r\n        'Bucket' => \\BCAPI\\v1\\Config\\AWS['s3-bucket'],\r\n        'Key' => $file,\r\n        'UploadId' => $uploadID\r\n    ]);\r\n    \r\n    return (string)$client->createPresignedRequest($cmd, TIME_NOW + $expires)->getUri();\r\n}\r\n```\r\n\r\nThus, how to used this URL in client. I can not find the answer in AWS documents.\r\n\r\n Does anybody help?\r\n\r\n> AWS says it's wrong due to invalid Authentication."},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/comments/244692435","html_url":"https://github.com/aws/aws-sdk-php/issues/1078#issuecomment-244692435","issue_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/1078","id":244692435,"user":{"login":"fenying","id":11142903,"avatar_url":"https://avatars.githubusercontent.com/u/11142903?v=3","gravatar_id":"","url":"https://api.github.com/users/fenying","html_url":"https://github.com/fenying","followers_url":"https://api.github.com/users/fenying/followers","following_url":"https://api.github.com/users/fenying/following{/other_user}","gists_url":"https://api.github.com/users/fenying/gists{/gist_id}","starred_url":"https://api.github.com/users/fenying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenying/subscriptions","organizations_url":"https://api.github.com/users/fenying/orgs","repos_url":"https://api.github.com/users/fenying/repos","events_url":"https://api.github.com/users/fenying/events{/privacy}","received_events_url":"https://api.github.com/users/fenying/received_events","type":"User","site_admin":false},"created_at":"2016-09-05T08:47:18Z","updated_at":"2016-09-05T08:47:18Z","body":"I post data to the generated URL\r\n```xml\r\n<CompleteMultipartUpload>\r\n  <Part>\r\n    <PartNumber>1</PartNumber>\r\n    <ETag>\"90fa27e977c04aa4d078919682d76a54\"</ETag>\r\n  </Part>\r\n  <Part>\r\n    <PartNumber>2</PartNumber>\r\n    <ETag>\"eca63d229126d5200a88e0ebc5336bed\"</ETag>\r\n  </Part>\r\n</CompleteMultipartUpload>\r\n```\r\n\r\nAnd S3 responsed with following info:\r\n\r\n```xml\r\n<Error>\r\n<Code>SignatureDoesNotMatch</Code>\r\n<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>\r\n<AWSAccessKeyId>AKIAP2AFGJ3NXBSAMPLE</AWSAccessKeyId>\r\n<StringToSign>AWS4-HMAC-SHA256\r\n20160905T083913Z\r\n20160905/cn-north-1/s3/aws4_request\r\ne18441ca55291f6d28209e6aad4d375b852cac7f03e04af39e71a359c9de21ad</StringToSign>\r\n<SignatureProvided>f0b572ae321c3e9a891fbb096b14f587b881607a51a12815b5d29c2021e66b98</SignatureProvided>\r\n<StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 36 30 39 30 35 54 30 38 33 39 31 33 5a 0a 32 30 31 36 30 39 30 35 2f 63 6e 2d 6e 6f 72 74 68 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 65 31 38 34 34 31 63 61 35 35 32 39 31 66 36 64 32 38 32 30 39 65 36 61 61 64 34 64 33 37 35 62 38 35 32 63 61 63 37 66 30 33 65 30 34 61 66 33 39 65 37 31 61 33 35 39 63 39 64 65 32 31 61 64</StringToSignBytes>\r\n<CanonicalRequest>POST\r\n/xxxxxxxxx-bucket/debug/upload.data\r\n%3CCompleteMultipartUpload%3E%0A%20%20%3CPart%3E%0A%20%20%20%20%3CPartNumber%3E1%3C%2FPartNumber%3E%0A%20%20%20%20%3CETag%3E%2290fa27e977c04aa4d078919682d76a54%22%3C%2FETag%3E%0A%20%20%3C%2FPart%3E%0A%20%20%3CPart%3E%0A%20%20%20%20%3CPartNumber%3E2%3C%2FPartNumber%3E%0A%20%20%20%20%3CETag%3E%22eca63d229126d5200a88e0ebc5336bed%22%3C%2FETag%3E%0A%20%20%3C%2FPart%3E%0A%3C%2FCompleteMultipartUpload%3E=&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Credential=AKIAP2AFGJ3NXBSAMPLE%2F20160905%2Fcn-north-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20160905T083913Z&amp;X-Amz-Expires=581&amp;X-Amz-SignedHeaders=host&amp;uploadId=0O7pQ8x5hGJCpdQzYHlaXNZwH7.bmTu5w0NwnMJIpBVlSoa8MxxVNs.35MED0AzhkRFakan9tYOksewrerTerpbMdewf0yW1yQyQDbB8w4BUe6MMhbsuHb25vsWo2d6s\r\nhost:s3.cn-north-1.amazonaws.com.cn\r\n\r\nhost\r\nUNSIGNED-PAYLOAD</CanonicalRequest>\r\n<CanonicalRequestBytes>50 4f 53 54 0a 2f 62 61 69 63 68 75 61 6e 2d 73 74 6f 72 61 67 65 2f 64 65 62 75 67 2f 75 70 6c 6f 61 64 2e 64 61 74 61 0a 25 33 43 43 6f 6d 70 6c 65 74 65 4d 75 6c 74 69 70 61 72 74 55 70 6c 6f 61 64 25 33 45 25 30 41 25 32 30 25 32 30 25 33 43 50 61 72 74 25 33 45 25 30 41 25 32 30 25 32 30 25 32 30 25 32 30 25 33 43 50 61 72 74 4e 75 6d 62 65 72 25 33 45 31 25 33 43 25 32 46 50 61 72 74 4e 75 6d 62 65 72 25 33 45 25 30 41 25 32 30 25 32 30 25 32 30 25 32 30 25 33 43 45 54 61 67 25 33 45 25 32 32 39 30 66 61 32 37 65 39 37 37 63 30 34 61 61 34 64 30 37 38 39 31 39 36 38 32 64 37 36 61 35 34 25 32 32 25 33 43 25 32 46 45 54 61 67 25 33 45 25 30 41 25 32 30 25 32 30 25 33 43 25 32 46 50 61 72 74 25 33 45 25 30 41 25 32 30 25 32 30 25 33 43 50 61 72 74 25 33 45 25 30 41 25 32 30 25 32 30 25 32 30 25 32 30 25 33 43 50 61 72 74 4e 75 6d 62 65 72 25 33 45 32 25 33 43 25 32 46 50 61 72 74 4e 75 6d 62 65 72 25 33 45 25 30 41 25 32 30 25 32 30 25 32 30 25 32 30 25 33 43 45 54 61 67 25 33 45 25 32 32 65 63 61 36 33 64 32 32 39 31 32 36 64 35 32 30 30 61 38 38 65 30 65 62 63 35 33 33 36 62 65 64 25 32 32 25 33 43 25 32 46 45 54 61 67 25 33 45 25 30 41 25 32 30 25 32 30 25 33 43 25 32 46 50 61 72 74 25 33 45 25 30 41 25 33 43 25 32 46 43 6f 6d 70 6c 65 74 65 4d 75 6c 74 69 70 61 72 74 55 70 6c 6f 61 64 25 33 45 3d 26 58 2d 41 6d 7a 2d 41 6c 67 6f 72 69 74 68 6d 3d 41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 26 58 2d 41 6d 7a 2d 43 6f 6e 74 65 6e 74 2d 53 68 61 32 35 36 3d 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44 26 58 2d 41 6d 7a 2d 43 72 65 64 65 6e 74 69 61 6c 3d 41 4b 49 41 50 32 41 46 47 4a 33 4e 58 42 4d 4d 4b 46 57 41 25 32 46 32 30 31 36 30 39 30 35 25 32 46 63 6e 2d 6e 6f 72 74 68 2d 31 25 32 46 73 33 25 32 46 61 77 73 34 5f 72 65 71 75 65 73 74 26 58 2d 41 6d 7a 2d 44 61 74 65 3d 32 30 31 36 30 39 30 35 54 30 38 33 39 31 33 5a 26 58 2d 41 6d 7a 2d 45 78 70 69 72 65 73 3d 35 38 31 26 58 2d 41 6d 7a 2d 53 69 67 6e 65 64 48 65 61 64 65 72 73 3d 68 6f 73 74 26 75 70 6c 6f 61 64 49 64 3d 30 4f 37 70 51 38 78 35 68 47 4a 43 70 64 51 7a 59 48 6c 61 58 4e 5a 77 48 37 2e 62 6d 54 75 35 77 30 4e 77 6e 4d 4a 49 70 42 56 6c 53 6f 61 38 4d 78 78 56 4e 73 2e 33 35 4d 45 44 30 41 7a 68 6b 52 46 61 6b 61 6e 39 74 59 4f 6b 73 65 77 72 65 72 54 65 72 70 62 4d 64 65 77 66 30 79 57 31 79 51 79 51 44 62 42 38 77 34 42 55 65 36 4d 4d 68 62 73 75 48 62 32 35 76 73 57 6f 32 64 36 73 0a 68 6f 73 74 3a 73 33 2e 63 6e 2d 6e 6f 72 74 68 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 2e 63 6e 0a 0a 68 6f 73 74 0a 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44</CanonicalRequestBytes>\r\n<RequestId>8E52F8C1F38D1970</RequestId>\r\n<HostId>EzGHTaKdYXbVyTwnWN1vh5nsUccbUy85MCa9oICN/g0AEpMvu2NsNcwIfp7yG2V1hk8kTYXldcQ=</HostId>\r\n</Error>\r\n```"}}
{"actor":{"display_login":"fenying"}}