title: Validate file's extension & size before uploading
body: <p>I tried to make a file uploader which can should be able to upload mimes viz.: <code>.jpg, .jpeg, .pdf, .bmp, .png, .doc &amp; .docx</code>. I also make a request rule given below:</p>
  <p><strong>StoreFileRequest.php</strong></p>
  <pre><code>public function rules()
  {
      'files.*' =&gt; [
          'mimes:jpg,jpeg,pdf,bmp,png,doc,docx',
          'max:20000',
      ],
  }
  </code></pre>
  <p><strong>Controller</strong></p>
  <pre><code>use App\Http\Requests\Backend\StoreFileRequest;
  
  public function store(StoreFileRequest $request)
  {
      if($request-&gt;hasFile('files'))
      {
          foreach ($files as $file) {
              //file Mime type
              $fileMimeType=$file-&gt;getClientMimeType();
  
              //change filename to laravel generated name using above extention
              $filename=$file-&gt;hashName();
  
              //upload file
              $path=$file-&gt;storeAs('public/user-existing-health-reports/'.auth()-&gt;user()-&gt;uuid,$filename);
          }
      }
  }
  </code></pre>
  <p><strong>blade</strong></p>
  <pre><code>{!! Form::file('files[]',
      array('class' =&gt; 'form-control btn btn-file ',
      'accept'=&gt;'.jpg, .jpeg, .pdf, .bmp, .png, .doc, .docx',
      'multiple',
      'required',
      )) !!}
  </code></pre>
  <p>Inspite of the validation rule above let's suppose if I try to upload a <strong><code>.zip</code></strong> &amp; also <strong><code>.rar</code></strong> file which are around <strong><code>1GB</code></strong>. The file gets uploaded first which takes quite a very good time and then throws an error after validating.</p>
  <p><strong>My issue:</strong> I need to validate the file extension and size when the user clicks the submit button before it uploads the file to validate via validator.</p>