I am writing an web api that accepts file as base64 string and converts it to two dimentional array. One of the requirements is to verify that the file is of type that is excepted and this should be done by validating the file base64 string. For example this is the validation for PDF. How to do it for xlsx & csv?
if (file.Take(7).SequenceEqual(PDF))
{
mime = "application/pdf";
}