Posted by Kimmo Laine on 08/31/06 09:17
<veg_all@yahoo.com> wrote in message
news:1156992615.595711.92560@b28g2000cwb.googlegroups.com...
>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@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|