S3 Metadata on file write

I have a need to write S3 metadata when writing a file. Has anyone ever done this?