Skip to content

Specify metadata on putObject calls #193

@apellerano-pw

Description

@apellerano-pw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions