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

Feature Request: pass file meta.data in uppy.onAdd() #2105

Closed
Aarbel opened this issue Mar 1, 2020 · 4 comments
Closed

Feature Request: pass file meta.data in uppy.onAdd() #2105

Aarbel opened this issue Mar 1, 2020 · 4 comments
Assignees
Labels
📖 Docs Stale Old issues that haven't had activity recently

Comments

@Aarbel
Copy link
Contributor

Aarbel commented Mar 1, 2020

Problem

I'd like to send many files in the same time but with different files metaData.
The combination of uppy.setMeta uppy.addFile doesn't wok because the upload is asynchronous, and when files finish to upload they will heritate the last uppy.setMeta configuration.

Moreover the uppy.setFileMeta method is quite impossible to use, because on uppy.addFile we can't declared an id, and there's even no way to pass data to uppy.on('file-added'

Request

Add the possibility to pass meta data directly in uppy.addFile options

@goto-bus-stop
Copy link
Contributor

Looks like you found out how it works in #2106? We should make sure it's documented that you can do addFile({ meta: {xyz} }), yes :)

@goto-bus-stop goto-bus-stop self-assigned this Mar 2, 2020
@Aarbel
Copy link
Contributor Author

Aarbel commented Mar 2, 2020

@goto-bus-stop i only passed relativePath key.
Seems other custom keys don't work inside addFile({ meta: ... })

@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Mar 9, 2020

Hmm if I do

const Uppy = require('@uppy/core')
const uppy = new Uppy()
const id = uppy.addFile({
  meta: { test: 'abc' },
  data: new ArrayBuffer(8192),
})
const file = uppy.getFile(id)

I do see test: 'abc' in the resulting file. Could you share some code that shows the problem?

@stale
Copy link

stale bot commented Mar 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 Docs Stale Old issues that haven't had activity recently
Projects
None yet
Development

No branches or pull requests

2 participants