title: upload file should accepts XLS files only file size limit 5mb Angular 13
body: <p>I need do upload file which accepts XLS files only file size limit 5mb Angular 13?</p>
  <p><strong>HTML</strong></p>
  <blockquote>
  <p><code>&lt;input name=&quot;file&quot; type=&quot;file&quot; (change)=&quot;onSelectFile($event)&quot; required/&gt; &lt;button type =&quot;file&quot;&gt; &lt;/button&gt;</code></p>
  </blockquote>
  <p><strong>Ts file</strong></p>
  <pre><code>onSelectFile(event:any){
  const allowed_type = ['application/xslx']
  if (this.file.size &gt;5000 * 1024 &amp;&amp; this.files.type !== allowed_type) {
  this.warning = true;     
   } else {
   this.warning = false; 
     }
  }
  </code></pre>
  <p>here I can only get warning msg on size limit not file type</p>
  <p>I need both the validations happen.</p>
  <p>also tried in this way:</p>
  <pre><code> if (this.file.size &gt;5000 * 1024) {
      this.warning = true;     
       } else if (this.files.type !== allowed_type){
       this.warning = true; 
      }else{
  this.warning = false;
  }
  </code></pre>
  <p>Here I should not allow more 5mb and file type should accept only xsl format.</p>