thepensionsregulator / govuk-frontend-aspnetcore-extensions

Adds client-side validation, additional components and editing in Umbraco to https://github.com/gunndabad/govuk-frontend-aspnetcore
MIT License
16 stars 1 forks source link

Add BinaryFileValidators for Excel and PDF #195851 #314

Closed samuelhaa closed 3 months ago

samuelhaa commented 3 months ago

Because

This is using the the FileSignatures repo on Github for the signature validation

Each file type will have a a certain set of bytes that defines the file type. We search the file for that signature to determine whether the uploaded file is a valid file.

A Google search on "File signatures" would give the file signatures for the most common file types.

We define the [AllowedFileTypeAttribute] that replaces [AllowedFileExtensionAttribute]

Ref:

AB #195851