aws / aws-sdk-java

The official AWS SDK for Java 1.x (In Maintenance Mode, End-of-Life on 12/31/2025). The AWS SDK for Java 2.x is available here: https://github.com/aws/aws-sdk-java-v2/
https://aws.amazon.com/sdkforjava
Apache License 2.0
4.13k stars 2.83k forks source link

Error doing an upload with metadata #223

Closed svoorakk closed 8 years ago

svoorakk commented 10 years ago

When doing an S3 upload with metadata, there is a 403 error . This can be worked around by URLEncoding the metadata keys so that the upload is successful. But it is not an ideal solution since anyone retrieving metadata should be aware that it needs to be URL decoded. Also viewing metadata in AWS console, metadata is displayed with url encoding. Details are provided here : http://stackoverflow.com/questions/23239304/error-with-aws-java-sdk-doing-an-upload-with-metadata

ankon commented 10 years ago

FWIW, metadata is transmitted as HTTP headers, so they should be conforming to RFC 2616 (Section 2 says header fields and values use US-ASCII only). As such any encoding you do to somehow fit in more/different characters is of course something AWS doesn't know (or has to care) about.

In our product we use RFC 2047 'b'-style encoding of the metadata values, which works fine, and happens to be rendered properly in the AWS console.

breedloj commented 8 years ago

Closing this since the issue is nearly 2 years old and this is expected behavior.