Validate the file list based on the amount of files in the list.
import { defineFilePond } from 'filepond';
import { locale } from 'filepond/locales/en-gb.js';
import { ListCountValidator } from 'filepond/extensions/list-count-validator.js';
defineFilePond({
locale,
extensions: [
// Add the ListCountValidator extension
[ListCountValidator, {
maxFiles: 3
}]
]
})
Configuration
The ListCountValidator extension accepts an option object of type ListCountValidatorOptions which defines the properties below.
minFiles
Min total files. Defaults to 0
minFiles?: string | number
maxFiles
Max total file. Defaults to Infinity
maxFiles?: string | number