Skip to content

Function: isValidFile() ​

ts
function isValidFile(file, acceptedFiles): boolean;

Defined in: core/src/validate/accept.ts:61

Whether a file passes a type list such as 'image/*,.pdf' (the syntax of the HTML accept attribute). An empty list accepts everything. A file with an empty MIME type is judged by the type its extension suggests.

Parameters ​

ParameterType
fileTypedName
acceptedFilesstring | readonly string[] | null | undefined

Returns ​

boolean

Released under the MIT License.