I've read the S3 documentation several times and I'm adding metadata to an S3 object with this code...
PutObjectRequest titledRequest = new PutObjectRequest();
titledRequest.WithTimeout(3600000)
.WithMetaData("outputfolder", outputFolder)
.WithBucketName(AWS_BUCKET_NAME)
.WithKey(objectKey)
.WithAutoCloseStream(true)
.WithInputStream(fs);
When reading the object from the S3 bucket I'm using this code....
string outputFolder = response.Metadata["x-amz-meta-outputfolder"];
But I'm getting an empty string every time even though the outputFolder variable definitely has a value.
Am I doing something really silly wrong here? As far as I can tell this is consistent with the documentation
string outputFolder = response.Metadata["outputfolder"];
will do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With