Handle storage with a callback function.
import { defineFilePond } from 'filepond';
import { locale } from 'filepond/locales/en-gb.js';
import { ValueCallbackStore } from 'filepond/extensions/value-callback-store.js';
defineFilePond({
locale,
extensions: [
// Add the ValueCallbackStore extension
ValueCallbackStore
]
})
Configuration
The ValueCallbackStore extension accepts an option object of type ValueCallbackStoreOptions which defines the properties below.
required
If the value is required or not. Defaults to false
required: boolean
valueKey
Need to know the value key. Defaults to 'value'
valueKey: string
entryToValue
Custom function to map an entry object to a value for use in FormData. By default will use valueKey to get a storage id from the entry.state, else will return entry.file if set.
entryToValue?: (entry: FilePondEntry) => string | void | File
onChange
Called when formdata object changed. Defaults to undefined
onChange: (currentValues: unknown[]) => void