tags:

views:

81

answers:

1

I have code which writes to something to s3 bucket.

 PutObjectRequest titledRequest = new PutObjectRequest();
 titledRequest.WithMetaData("Eip1", "Volume-1")
.WithMetaData("Eip2", "Volume-2")
 .WithContentBody("this is an Elastic IP Address Details for a Volumes")
  .WithBucketName(bucketName)
 .WithKey(keyName);

and read it using

   AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKeyID,  secretAccessKeyID);

 GetObjectRequest request = new GetObjectRequest().WithBucketName(bucketName).WithKey(keyName);

    string title = response.Metadata.Get("Eip1");

but getting null in return , when debugged i saw response.Metadata.Keys have

x-amz-meta-eip1
& x-amz-meta-eip2

How this keys are being renamed , How to Avoid this ?

Why they are being prefixed with x-amz-meta-

+1  A: 

They are prefixed this way by design "to distinguish them as custom HTTP headers"

http://docs.amazonwebservices.com/AmazonS3/latest/index.html?UsingMetadata.html

willbt
Gotta love documentation. :)
Curt Nichols