createPresignedPost upload attempt in results in 400 (Bad Request)

0

When attempting to use a presigned post url to upload an image to s3, a 400 (Bad Request) response is returned from S3

I'm using the Vercel S3 upload example as the pattern

The Lambda function (node js) returning the presigned url is using a user with Administrative Access

S3 has the following CORS policy

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "PUT",
            "POST"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

How can I resolve this issue an successfully upload to s3?

질문됨 2년 전297회 조회
3개 답변
1

In my experience, this happens when the request doesn't exactly match the presigned URL that was created.

Make sure that you include the content type when signing the URL; and that the content type is the same when you send the request.

profile pictureAWS
전문가
답변함 2년 전
0
수락된 답변

I was using a customer managed key improperly instead of the s3 managed key. That was the more specific issue

답변함 2년 전
0

After using Postman, I found out the issue is KMS. Server side encryption was enabled on the bucket and that was causing the error

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠