3

I try to send base64 png image file to AWS s3 using putObject.

And I wonder that exactly what is payload?

payload = hash(base64Image) ?

here is a detail.

    $img = str_replace('data:image/png;base64,', '', $img);
    $img = str_replace(' ', '+', $img);

I returned that Message: S3::putObject(): [SignatureDoesNotMatch] The request signature we calculated does not match the signature you provided. Check your key and signing method.

Request

PUT /Bucketname/filename.png
x-amz-content-sha256=hash('sha256', $img)
x-amz-date=20160309T113423Z
Host=bucketname.s3-ap-northeast-2.amazonaws.com
Content-Type=image/png
Content-Encoding=base64 or not
Content-Length=120068
Auth~= AWS4...~

I used php-curl and not SDK, https://github.com/psugand/CodeIgniter-S3

I changed AUTH to AWS4 and test listBueckts();

what's problem?

Taehong
  • 31
  • 3

0 Answers0