0

I need to validate the file extension from all sort of types of files that get uploaded. I only have the Base64 string and the filename. I am not allowed to use the file extension from the filename to validate the extension.

I would do it with the magic numbers but I couldn't find a list where all magic numbers from all mime-types/file extensions are listed.

Thanks in advance.

campi
  • 11
  • 1
  • 5
  • There are only common file types unfortunately. I need a lot more. Is there any way I can extract the file type from the Base64 string dynamically? – campi Aug 04 '21 at 13:35
  • This is the closest you will get: https://stackoverflow.com/questions/58510/using-net-how-can-you-find-the-mime-type-of-a-file-based-on-the-file-signature/13614746#13614746 – rene Aug 04 '21 at 13:55

0 Answers0