AWS: how to fix S3 event replacing space with '+' sign in object key names in json

后端 未结 7 1414
名媛妹妹
名媛妹妹 2020-12-31 00:23

I have a lamba function to copy objects from bucket \'A\' to bucket \'B\', and everything was working fine, until and object with name \'New Text Document.txt\' was created

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 01:06

    I was facing same issue with special character's, as aws S3 event replacing the special character's as in UrlEncoding. So to resolve the same I have used aws decode API "SdkHttpUtils.urlDecode(String key)" to decode the object key. Hence worked as expected.

    You can check below link to get more details about SdkHttpUtils API.

    https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/util/SdkHttpUtils.html#urlDecode-java.lang.String-

提交回复
热议问题