$_files
Hi all!
I have a question: I am constructing a form where the user can upload a file.
I need however to verify that the file uploaded is a TEXT file.
Is $_FILE['userfile']['type'] what I need? I am asking this because no matter if I upload a .txt or a .gif file, PHP says they are both $_FILE['userfile']['type']='text' and so, they are both uploaded on the server, whereas there should be only .txt file uploaded and not the .gif file.
In general, how can I allow only text files to be uploaded?
(Of course, i can't rely much on the extension I believe)..
Thanx
|