I need a way to set metadata on uploaded items. What about an API like this?
s3: {
accessKeyId: '<your-aws-access-key>',
secretAccessKey: '<your-aws-secret>',
bucket: '<your-s3-bucket>',
region: '<the-region-your-bucket-is-in>',
metadata: {
key1: 'foo',
key2: 'bar',
},
}
And then _putObject in lib/s3.js can read options.metadata and add to params. Basically a passthru.
var params = {
...existingStuff,
Metadata: metadata
};
It would be up to the end user whether they want to use keyNames that S3 will collapse to x-amz-meta-keynames or key-names to get x-amz-meta-key-names. In other words, this library would have no opinion about how metadata key names should be formatted.
It would also be the end user's responsibility to convert their datatypes to String.
I need a way to set metadata on uploaded items. What about an API like this?
And then
_putObjectin lib/s3.js can readoptions.metadataand add to params. Basically a passthru.It would be up to the end user whether they want to use
keyNamesthat S3 will collapse tox-amz-meta-keynamesorkey-namesto getx-amz-meta-key-names. In other words, this library would have no opinion about how metadata key names should be formatted.It would also be the end user's responsibility to convert their datatypes to String.