Development with AWS Services
An Amazon S3 event notification contains the object key reports%2FJune+sales.csv. Which decoding operation should a consumer apply before using the key to retrieve the object?
Show the answer
Correct answerB. Apply form-style URL decoding, including converting plus signs to spaces.
AWhy not this: Preserving the plus sign produces a different object key from the one in the notification.
BWhy this is right: S3 notification keys use form-style encoding, where %2F represents a slash and a plus sign represents a space.
CWhy not this: Parsing the surrounding JSON does not decode URL-encoded characters within the key.
DWhy not this: S3 notification object keys use URL encoding, not Base64 encoding.
S3 event notifications encode object keys using application/x-www-form-urlencoded rules, so the decoded key is reports/June sales.csv. Percent decoding that leaves the plus sign unchanged produces the wrong key.