Validate files based on their mime type.
The FileMimeTypeValidator extension can be configured with the FileMimeTypeValidatorOptions object.
When using defineFilePond the value of the accept attribute on the <input type="file"> is automatically passed to this extension.
import { defineFilePond } from 'filepond';
import { locale } from 'filepond/locales/en-gb.js';
import { FileMimeTypeValidator } from 'filepond/extensions/file-mime-type-validator.js';
defineFilePond({
locale,
extensions: [
// Add the FileMimeTypeValidator extension and configure with FileMimeTypeValidatorOptions object
[FileMimeTypeValidator, {
accept: ['image/jpeg', 'image/png']
}]
]
})