How to get Html::fileInput() value in yii2 Action?
<p>I am using <code>&lt;?= Html::fileInput() ?&gt;</code> instead of <code>&lt;?= $form-&gt;field($model, 'image_file')-&gt;fileInput() ?&gt;</code> because i haven't passed any model to my form I am using Yii2 active form.</p>

<p>Now My question is that when i post this form how could i access this file in my action. I could see the file attributes using $_FILES variable. but is there any Yii method to access it.</p>

<p>I tried this also:</p>

<pre><code>$documentObject = UploadedFile::getInstance(Yii::$app-&gt;request-&gt;post(), 'image_file');
</code></pre>

<p>but it is showing this Exception</p>

<pre><code>Call to a member function formName() on array
</code></pre>

<p>Now how to access this file in action</p>

<p>Thanks in advance for any kind of help.</p>