manuelBetancurt
manuelBetancurt

Reputation: 16128

AWS S3 Presigned URL upload image with postman

I need to upload a file to S3 with postman for testing. I have a generated presigned URL from S3.

But I don't know how to configure postman correctly for doing this PUT request to my generated presigned URL.

The response on postman with malformed headers is:

<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

the params for the presigned request:

const params = {
  Bucket: 'ss-files-dev',
  Key: 'dansero.jpg',
  ContentType: 'image/jpeg',
  Expires: 100
};

I get the URL, then enter it in postman, with PUT request, but the headers are not complete? 1. if I add content-type on header, there is no response from server 2. in body for the request Im attaching file as "binary"

postmanConfig

How to do my PUT request from postman?, thanks

Upvotes: 10

Views: 22177

Answers (3)

user714157
user714157

Reputation: 419

For me, Postman added hidden headers. If I remove the Content-Type header, the Put worked as expected.

Upvotes: 10

mojoken
mojoken

Reputation: 1362

I was able to get this working in Postman using a POST request with “form-data” input. I put all the details in this stack overflow post.

Upvotes: 2

Rez Moss
Rez Moss

Reputation: 4604

Make sure about the following things:

1-The file name equal and same as the key when you get the signed URL.

2-Get the signed URL for putObject by passing the right parameter to getSignedUrl.

For put request not needs to set any additional headers.

Upvotes: 5

Related Questions