isValidFile

Checks whether specified file data matches an extension. Currently this supports ".jpg, .jpeg, .gif, .png, .pdf"

bool
isValidFile
(
string extension
,
ubyte[] data
)

Parameters

extension string

The extension of the file.

data ubyte[]

The data to validate.

Return Value

Type: bool

True if the data is valid for the extension given, false otherwise. Unhandled extensions returns true.

Meta