From AWS documentation :
The name for the key is a sequence of Unicode characters whose UTF-8 encoding has a length of not more than 1024 bytes.
Thus, "ab # 1" and "ab # 2" are valid key names, then the problem is probably in your client code, check the documentation of your Http client.
AWS also warns about using special characters:
You can use any UTF-8 character in the object key name. However, using certain characters in key names can cause problems with some applications and protocols. The following guidelines will help you achieve maximum compatibility with DNS, network-safe characters, XML parsers, and other APIs.
- Alphanumeric characters:
0-9
, az
, AZ
- Special characters
!
, -
, _
, *
, '
, (
, )
Therefore, either limit the set of available characters in your application to allow only recommended characters, or fix the problem at the client level.
source share