1

URL example: https://xxxxxxxxxx.s3.amazonaws.com/xxxx-xxxx-xxxx-xxxx/xxxxxxxxxxxxx/x?AWSAccessKeyId=AKIAIFKEBR4CLVTDYSLA&Signature=Kv%2B859dJ2eUmLgHdkT%2F9nUJEeRM%3D&Expires=1922517562

I tried to decode %XX but no success.

Also I tried aws s3 cp s3://xxxxxxxxxx/xxxx-xxxx-xxxx-xxxx/xxxxxxxx... - --recursive but Streaming currently is only compatible with non-recursive cp commands - I need to stream multiple files from S3.

Using wget I am getting the same 403.

URL from s3_client.generate_presigned_url.

2

Use single quotes to make sure that any potentially special characters are taken literally.

[user@localhost ~]# curl 'https://xxxxxxxxxx.s3.amazonaws.com/xxxx-xxxx-xxxx-xxxx/xxxxxxxxxxxxx/x?AWSAccessKeyId=AKIAIFKEBR4CLVTDYSLA&Signature=Kv%2B859dJ2eUmLgHdkT%2F9nUJEeRM%3D&Expires=1922517562'

The key is single quotes.

3
  • 1
    As it turns out - it does not work for all cases... Any other trick? Apr 7 '18 at 20:21
  • What sort of cases is it not working for? If you're doing any variable substitution in the URL it won't work between the single quotes. Apr 9 '18 at 4:42
  • Works great for me. Was getting an Access Denied without the single quotes. Thanks! Sep 8 '19 at 2:29
-1

Aha, I found that curl can download unquoted url (/ instead of %2F) when such url in "double quotes".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.