How do I upload a file to S3 with a signed URL?
I tried the following:
const AWS = require('aws-sdk');
const s3 = new AWS.S3({ accessKeyId: "", secretAccessKey: "" });
const url = s3.getSignedUrl("putObject", {
Bucket: "SomeBucketHere",
Key: "SomeNameHere",
ContentType: "binary/octet-stream",
Expires: 600
});
But when I try uploading with Postman using the following steps, I get the SignatureDoesNotMatch
error.
- PUT method with URL from the above code
- Body:
binary
(radio button), choose file, select a file to upload - Hit Send
I can confirm that the IAM permissions are not the problem here. I have complete access to the Bucket.
What's wrong and how do I test my signed URL?