I have a script where a user can upload their csv file into a mysql
database. The problem is sometimes a user will upload the raw excel or
access file. How can I perform some simple checks to determine if the
file is binary. I could do some regular expressions to check for
unusual characters, but how would I read the file line by line?