I am in the process of making a web application. It allows you to upload a .txt or .log file (IIS Logs for example).
The current way I am checking if it is a .txt or .log is checking the file extension. Now I don't like this as it allows anyone to change virus.exe
to virus.txt
and it will upload.
How can I verify if it really is a text file? I am sure this is a common problem, but I can't seem to find any good solutions.