Skip to content

Adds the ability to manage metadata for uploaded files to the FilePond plugin

License

Notifications You must be signed in to change notification settings

nielsboogaard/filepond-plugin-manage-metadata

Repository files navigation

Manage metadata plugin for FilePond

License: MIT npm version

The Manage Metadata plugin will add a tiny 'edit' icon in front of the filename to allow updating the metadata of the uploaded file.

Quick Start

Install using npm:

npm install filepond-plugin-manage-metadata

Then import in your project:

import * as FilePond from 'filepond';
import FilePondPluginManageMetadata from 'filepond-plugin-manage-metadata';

Register the plugin:

FilePond.registerPlugin(FilePondPluginManageMetadata);

Create a new FilePond instance as normal.

const pond = FilePond.create({
    name: 'filepond'
});

// Add it to the DOM
document.body.appendChild(pond.element);

The functionality will become active after uploading a file.

Configuration

The following options can be provided:

const pond = FilePond.create({
    name: 'filepond',
    enableManageMetadata: true, // by default true, can be used to disable this plugin for a particular FilePond instance
    labelButtonManageMetadata: 'custom label', // by default 'Edit metadata'
    onManageMetadata: (item) => console.log('onManageMetadata hook called', item) // callback method which will be called upon clicking the edit icon
});

Demo

View the demo