question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question : how could we customize files meta-data ?

See original GitHub issue

Hi Uppy Teams

i’m just discovering Uppy, i need to put an other meta-data field in this view, do you think it will be easy to do it using Uppy ? We can put a Caption, i would like to add a Recipients input (which will be a React Component)

image

Thanks a lot

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
goto-bus-stopcommented, Aug 30, 2018

If you would like to PR it that would be very helpful!

I think, a good way to approach this is to allow the values of the Dashboard’s metaFields option to have a render() method that receives a props object (name, id, value onChange handler) and returns a Preact element. Then, we can use that Preact element in place of our default <input type="text">. I imagine it’d be used like this:

uppy.use(Dashboard, {
  /* ..., */
  metaFields: [
    {
      id: 'location',
      name: 'Coordinates',
      render ({ value, onChange }) {
        return <CoordinateSelector
          currentCoordinates={value.split(',')}
          onChange={(coords) => onChange(`${coords[0]},${coords[1]}`)}
        />
      }
    }
  ]
})

The rendering happens here: https://github.com/transloadit/uppy/blob/d6578197ca9cfab904ebd051bdb0f28720fc9e56/packages/%40uppy/dashboard/src/components/FileCard.js#L40-L57

Until the user presses “Save changes” in the dashboard, all changes are stored in the FileCard component’s this.meta property. I think, if the same would be done for the values gotten from a custom render() function, no additional changes need to be made to save those values to the file’s metadata object.

0reactions
kvzcommented, May 22, 2019

We love this idea, but will probably do it via jsx rendering as was mentioned by Renee and also discussed in https://github.com/transloadit/uppy/issues/617

Closing this one then!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom meta data to windows files - Super User
Short answer: No, those attributes are built into the file system. You could maybe fake your own meta-data, with a little programming.
Read more >
Work with metadata in Adobe Bridge
You can create new metadata templates in Adobe Bridge by using the Create Metadata Template command. You can also modify the metadata in...
Read more >
Create customized header (metadata) for files - Stack Overflow
Save this question. Show activity on this post. Here I want to create a header which contains other file details like metadata of...
Read more >
Using Metadata - Box Support
Custom Metadata : If no relevant metadata template exists, you can create a custom template for a particular file. When choosing a template, ......
Read more >
Everything you wanted to know about media metadata, but ...
Exiftool is an open source software program that allows you to analyze, edit, and clear metadata. While it's capable of handling multiple file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found