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

后端 未结 7 1437
名媛妹妹
名媛妹妹 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 00:49

    Since we are sharing for other runtimes here is how to do it in NodeJS:

    const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " "));
    

    From the AWS docs here

提交回复
热议问题