file upload problem

I an trying to upload a file with a form,so when I change the validation ryle ‘skipOnEmpty’ from true to false.

Then when I select a file I can not upload it,I have the message Please upload a file,when I set skipOnEmpty true I can upload file.What is wrong?

return [


            [['file'], 'file', 'skipOnEmpty'  => false, 'extensions' => 'png, jpg,doc,pdf,docx,gif'],

Without seeing more of your code, there’s not much I can offer. Is there a possibility that you’re trying to upload a document, but there’s simply nothing in it?