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' => ['accept' => 'application/pdf',],'pluginOptions'=>['allowedFileExtensions'=>['pdf']]
]) ?>
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