Question

I would like to download some files uploaded on my S3 Server.

For the moment, all my buckets and files inside them are public, so I can download what I want. Unfortunately, I can't access to files using special characters like a space or "&"...

I tried to change the special characters in my URL by HTML code :

http://s3-eu-west-1.amazonaws.com/custom.bucket/mods/b&b.jar

by

http://s3-eu-west-1.amazonaws.com/custom.bucket/mods/b%26b.jar

But I always have the same error :

<Error>
    <Code>AccessDenied</Code>
    <Message>Access Denied</Message>
    <RequestId>3E987FCE07075166</RequestId>
    <HostId>
        O2EIujdbiAeYg44rsezQlargfT7qVSL8SpqbTxkd/1UwxQrwZ3SJ+R3NlHyGF7rI
    </HostId>
</Error>

Anybody could resolve this problem ?

I can't rename them because there are used by other applications.

Was it helpful?

Solution

I am able to download public files with '&' in the name with no problems using curl:

curl https://s3.amazonaws.com/mybucket/test/b%26b.jar

Recheck the permissions on your file using the AWS console. Make sure the file has "Grantee: Everyone", and Open/Download permissions clicked, as in this screenshot:

AWS Console Screenshot

Make sure to click the "save" button after you add these credentials. Alternatively, try using your security credentials.

OTHER TIPS

I am able to download file with special character:

# wget --no-check-certificate https://s3-us-west-2.amazonaws.com/bucket1234/b%26b.jar
--2013-12-01 14:15:20--  https://s3-us-west-2.amazonaws.com/bucket1234/b%26b.jar
Resolving s3-us-west-2.amazonaws.com... 54.240.252.26
Connecting to s3-us-west-2.amazonaws.com|54.240.252.26|:443... connected.
WARNING: certificate common name `*.s3-us-west-2.amazonaws.com' doesn't match requested host name `s3-us-west-2.amazonaws.com'.
HTTP request sent, awaiting response... 200 OK
Length: 0 [application/x-java-archive]
Saving to: `b&b.jar'

    [ <=>                                                                             ] 0           --.-K/s   in 0s      

2013-12-01 14:15:22 (0.00 B/s) - `b&b.jar' saved [0/0]

Are you sure that this file is "Publicly visible"? could you double check the permissions for this file ? This is definitely not an issue with the special character.

Can you just login to aws s3 console and check what download link shows there?

Is there any mismatch in the link because of double encoding? Please make sure you are not doing any URL encoding from your code while uploading file.

In your case it could be:

http://s3-eu-west-1.amazonaws.com/custom.bucket/mods/b%2526b.jar

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top