in reply to Understanding File Type
I think you can check the first few bytes/characters of the file, to see whether they're simple text, or .DOC format. It appears that the first few characters in a Word .DOC file are ÐÏࡱá, which do not in general resemble what you find in text files. I don't know how reliable this is, but my guess is that Word docs will have some odd characters in them early on, and that could be a way of identifying the type independent of the extension.
|
|---|