Im in the process of developing a web app and I need to include some functionality... I need to be able to perform a test on a file to see if it is a valid font file and if yes, what type. I know that I could do a check on the file extension but that's not really sufficient. Is there a way of doing this? Thanks
Unfortunately, there is no easy way to do it. The header of a font file does not contain specific data to help you identify that it is indeed a font file (there is nothing similar with the "MZ" for the exe files - first two bytes in an exe). Anyway, here's some links to help you with the format: http://support.microsoft.com/kb/65123 http://www.fortunecity.com/skyscraper/apple/308/html/appendc.htm
Ok thanks, I suppose checking the extension will have to do - Ill just throw in a user/visual validation stage. Thanks