I have a system that processes TXT files and RTF files and converts them using a 3rd party tool. I have to integrate with another system that produces files with a .RTF extension but are actually just .TXT files. Unfortunately there is no consistent file names or text to search for. I have no control over the source files.
Is there a way in c# to check if a file has an RTF file header so I can establish if the file is RTF or TXT without using the extension?
This is part of a web application so I dont want to automate opening MS word or any other bulky tools to check if a file is RTF or not.