![]() |
|
? |
![]() PHP FAQ PHP Articles PHP Help Bulletin Board PHP Manual (NEW!) First Time PHP'ers Help with programming Sql assignment help PHP Homework Help
|
? |
|
|||||||||||||||
?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 ">??![]() |