Re: How to check if uploaded file is binary or ascii?



<veg_all@xxxxxxxxx> wrote in message
news:1156992615.595711.92560@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?

how about check the type-value? It should tell the mime-type of the file.
Couldn't you use that to filter out the idiots?
$_FILES['userfile']['type']



--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
spam@xxxxxxxxxxxxx || Gedoon-S @ IRCnet || rot13(xvzzb@xxxxxxxxxxxxx)


.


Quantcast