Amazon S3 URL Encoding

If I have a file name

a'd1 & "[tttt]" + 'sq.jpg

When it is uploaded to Amazon S3, it will be converted to this.

a'd1 & %22[tttt]%22 + 'sq.jpg

Thus, double quotes are encoded by URLs and the file name itself changes.

File must be extracted using encoded URL

a%27d1+%26+%2522%5Btttt%5D%2522+%2B+%27sq.jpg Thus, the encoding rules are as follows:

": %2522  (double encoded)
Space: + 
&: %26 
[: %5B
]: %5D
+: %2B 

Is there a way to define all the rules that S3 requires? Normal javascript coding with (encodeURI or even encodeURIComponent) will not work

+4
source share
1 answer

This is not from a specific source, but it worked for my requirements: encodeS3URI

It replaces the following characters +!"#$&'()*+,:;=?@

S3 +, URI

+1

All Articles