Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass metadata to Companion getKey() option for S3 uploads #1866

Merged
merged 5 commits into from
Dec 9, 2019

Conversation

goto-bus-stop
Copy link
Contributor

@goto-bus-stop goto-bus-stop commented Oct 7, 2019

This will provide an official way to use metadata inside an S3 object path.

It adds a metaFields option to the @uppy/aws-s3 plugin. Unlike the metaFields options in other plugins, it does not send any metadata by default, because the S3 plugin has not been sending metadata in the past. Instead you must explicitly use metaFields: null to send all metadata (which is not the most intuitive but typically you don't need to send everything anyways).

After this change, metadata is stored on the objects in the S3 buckets for both @uppy/aws-s3 and @uppy/aws-s3-multipart.

For the moment, @uppy/aws-s3-multipart still does not have an option to selectively send metadata.

Will add docs after #1861 to avoid merge conflict.

Closes #1792.

@goto-bus-stop goto-bus-stop marked this pull request as ready for review December 4, 2019 10:48
@ifedapoolarewaju
Copy link
Contributor

Instead you must explicitly use metaFields: null to send all metadata

I couldn't find where this condition is being enforced 🤔

@goto-bus-stop
Copy link
Contributor Author

whoops, that's right. This doesn't support sending all metadata. tbh, i think whitelisting is better anyways, so i don't really want to add a way to send everything :D although it's a bit surprising if the other plugins support it but not this…

@juliankoehn
Copy link

interface AwsS3Options extends Uppy.PluginOptions {
    companionUrl?: string
    getUploadParameters?: (
      file: Uppy.UppyFile
    ) => MaybePromise<AwsS3UploadParameters>
    timeout?: number
    limit?: number
  }

is missing the metaFields

@goto-bus-stop
Copy link
Contributor Author

@juliankoehn yes, thanks for mentioning that! fixing in ad14a01

HeavenFox pushed a commit to docsend/uppy that referenced this pull request Jun 27, 2023
…dit#1866)

* aws-s3: send metadata to companion

* companion: apply non-multipart s3 metadata to object

* companion: add metadata parameter to getKey() api

* docs: add `metadata` parameter for `getKey`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send additional data to Companion to create a directory in S3
3 participants