pdf file validation returing false

I am using this rule

[[‘resume’], ‘file’,‘skipOnEmpty’ => false, ‘extensions’ => ‘pdf’],

to allow ony pdf file to be uploaded

and my view file is using

use kartik\widgets\FileInput;

                                      ])   ?>

<?= $form->field($model, ‘resume’)->widget(FileInput::classname(), [

                   'options' =&gt; ['accept' =&gt; 'application/pdf',],'pluginOptions'=&gt;['allowedFileExtensions'=&gt;['pdf']]


                                        ])      ?&gt;

when I trierd to save model->save() it is returning false

if I change file tpe to Image it is working can anyone have uploaded pdf and checked its file extension or mime type

I had alredy read this post https://github.com/yiisoft/yii2/blob/master/docs/guide/input-file-upload.md

I just tried this and it works.

File Input Options Yii2 Docs




 [ 'MyFile', 'file',

 'extensions' => ['pdf'], 

'wrongExtension' => 'Only PDF files are allowed for {attribute}.',

 'wrongMimeType' => 'Only PDF files are allowed for {attribute}.',

 'skipOnEmpty'=>false,

'mimeTypes'=>['application/pdf']],



Bootstrap File Input Options




 <?=

        	$form->field($model, 'MyFile')->widget(FileInput::classname(), [

            	'options' => ['multiple' => false, 'class' => 'form-control'],

            	'pluginOptions' => ['previewFileType' => false, 'showUpload' => false, 'showPreview' => false, 'showRemove' => true, 'allowedFileExtensions' => ['pdf']]

        	]);

        	?>



I noticed your attribute is resume. Are you making a job board/ online application? I’m actually making one right now in Yii2 and that’s where the above code came from. Do you have any screen shots or demos just curious.