3

I've been trying to make use of the presign URL to put a file into my private S3 bucket. But I kept receiving this error message

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

The presign URL was generated using this command

aws s3 presign s3://<bucket-name>/<file-name> --expires-in 300

But when I do a curl PUT request, the error occurred

curl -T "<file-name>" "<Generated presign url>"

Did some research saw people talking about adding the 'Content_Type' in the header when requesting for the presign URL, but the aws cli doesn't have that flag to include.

Is it possible to do a put request through aws cli??

JustStarted
  • 199
  • 4
  • 13

1 Answers1

4

AWS CLI doesn't support presigned PUT URL yet. You can easily generate one using Python Boto3 though. The documentation is here. If you want a presigned PUT, you just need to let ClientMethod param be put_object.

jellycsc
  • 10,904
  • 2
  • 15
  • 32