Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel 5.1 error in validating doc docx type file

Hi i am facing a docx type validation problem. I tried

$validator = Validator::make($request->all(), [
            'resume'   => 'mimes:doc,pdf,docx'
        ]);

It will upload pdf file with no error but whenever i try to upload docx files it gives validation error 'must be a file of type: doc, pdf, docx'
any idea

like image 806
sanu Avatar asked Nov 30 '15 07:11

sanu


1 Answers

thanks solved it by allowing zip

$validator = Validator::make($request->all(), [
            'resume'   => 'mimes:doc,pdf,docx,zip'
        ]);

this is because https://en.wikipedia.org/wiki/Office_Open_XML

like image 133
sanu Avatar answered Jan 03 '23 22:01

sanu