0
votes

I am trying to upload a media file (image with any extension jpg/png/jpeg or a video) to aws s3 bucket from the postman i created my pre-signed url in my backend as following

const params = {
        Bucket: 'safarni',
        Key: 'posts/Photo.png',
        Expires: 30* 60,
        ContentType: 'binary/octet-stream'
    }

return await s3.getSignedUrlPromise('putObject', params) 

This successfully generates a url but I can't seem to test it using postman this is screenshots to how I adjust the request in postman

enter image description here

enter image description here enter image description here

What i tried :

1- I added cors policy to my bucket and the credentials I am using is for IAM user whom i allowed put/*

2-I tried different file extensions but still the same error

Edit

I tried adding the signature version v4 to params in the above code and it throwed me an error saying unexpected key.I even tried adding it to aws config and s3 but nothing happened

2

2 Answers

0
votes

Try to pass these signature values in Authorization. Looks like the keys are mismatched.

0
votes

A guess, maybe im wrong, Sharing this might help, aws use signature version 4 for all regions https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html

Check this thread this might help https://github.com/postmanlabs/postman-app-support/issues/1663