laravel 5.1 error in validating doc docx type file

后端 未结 2 503

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

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


        
相关标签:
2条回答
  • 2021-01-06 02:30

    In Laravel 5.6.3., I have solved this using dot(.) sign:

    $request->validate([
        'file.*' => 'required|file|max:5000|mimes:pdf,docx,doc',
    ]);
    
    0 讨论(0)
  • 2021-01-06 02:45

    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

    0 讨论(0)
提交回复
热议问题