File Type Valdiation Not Work

Hello Friends,

I created form to upload files , also model to validate types .

If I upload php file or any file will upload in successful way ,

but in model i added files type

just "pdf,doc,docx"

How to fix it ?

Model:-


array('attachment','file','types'=>'pdf,doc,docx', 'maxSize'=>5 * 1024 * 1024, 'allowEmpty'=>true,'tooLarge'=>'The document was larger than 5MB. Please upload a smaller document.',),

when i upload docx file then it gives error like this:-