?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


?
?$_FILES
Author:?kostas?(---.ozo.com)
Date:???10-10-05 01:39

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

?Topics Author? Date
?$_FILES??new
kostas 10-10-05 01:39?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??wrote: > > 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 ">??

Provided By
Phorum