title: Codeigniter 4 validation upload file with rule extension is not work as expected
body: <p>I have an import feature and this my code</p>
  <pre><code>public function import($id = NULL)
      {
          if ($this-&gt;request-&gt;getMethod() == 'post') {
              if (empty($id) &amp;&amp; $id != '0') {
                  $rules = [
                      'template' =&gt; [
                          'label' =&gt; 'Template',
                          'rules' =&gt; 'uploaded[template]|ext_in[template,xlsx]'
                      ]
                  ];
  
                  if (!$this-&gt;validate($rules)) {
                      return $this-&gt;respond([
                          'type' =&gt; 'failed',
                          'message' =&gt; $this-&gt;validator-&gt;getError(&quot;template&quot;)
                      ]);
                  }
  
                  if ($file = $this-&gt;request-&gt;getFile('template')) {
                      if ($file-&gt;isValid() &amp;&amp; !$file-&gt;hasMoved()) {
                          $newName = $file-&gt;getRandomName();
                          $file-&gt;move(WRITEPATH . &quot;cache&quot;, $newName);
  
                          try {
                              $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
                              $spreadsheet = $reader-&gt;load(WRITEPATH . &quot;cache&quot; . DIRECTORY_SEPARATOR . $newName);
                              $sheetData = $spreadsheet-&gt;getActiveSheet()-&gt;toArray(null, true, true, true);
  
                              if (count($sheetData) &lt; 2) {
                                  throw new \Exception(&quot;Unable to import empty files&quot;);
                              }
  
                              return $this-&gt;respond([
                                  'type' =&gt; 'success',
                                  'token' =&gt; $newName,
                                  'rows' =&gt; count($sheetData) - 1
                              ]);
                          } catch (\Exception $e) {
                              return $this-&gt;respond([
                                  'type' =&gt; 'failed',
                                  'message' =&gt; $e-&gt;getMessage()
                              ]);
                          }
                      }
                  }
              } else {
                  $token = $this-&gt;request-&gt;getPost('token');
                  $last = $this-&gt;request-&gt;getPost('last');
                  $filePath = WRITEPATH . &quot;cache&quot; . DIRECTORY_SEPARATOR . $token;
  
                  if (!$this-&gt;model-&gt;importExcel($filePath, $id)) {
                      return $this-&gt;respond([
                          'type' =&gt; 'failed',
                          'message' =&gt; 'Failed to import kpi',
                      ]);
                  }
  
                  if ($last == '1' &amp;&amp; file_exists($filePath)) {
                      unlink($filePath);
                  }
  
                  return $this-&gt;respond([
                      'type' =&gt; 'success',
                      'message' =&gt; 'The kpi were imported successfully',
                  ]);
              }
          }
  
          $data = [
              'formAction' =&gt; base_url(&quot;scorecard-tbcci/reporting/master-kpi/import&quot;),
              'formMethod' =&gt; 'POST',
          ];
  
          echo view('ScorecardTbcci\Views\Reporting\Kpis\ImportFormView', $data);
      }
  
  </code></pre>
  <p>the problem is, when I upload <em>xlsx</em> file. this file doesn't passed the validation. error warning will appear <strong>&quot;Upload doesn't have a valid file extention&quot;</strong>. so I try with <em>xls</em> file and I change the rule too but it same. When I change rule with <em>csv</em> and upload csv file. it passed the validation. i don't know what's the problem. can anyone help me ?</p>