title: How to upload multiple images in Angular 4
body: <p>I want to upload multiple images in Angular, still, I am uploading single images but now I want to upload max 5 images.
  for the single images, I have a parameter called <code>attached_image</code> where a single image is storing, but here I want to upload multiple images in <code>optionimage</code> parameter.</p>
  
  <p>This is  my <strong>component.html</strong></p>
  
  <pre><code>&lt;div class="col-sm-8  col-xs-6"&gt;
    &lt;div class="file-upload upload-button"&gt;
      &lt;input id="custom-input" type="file" (change)="handleFiles($event)" multiple&gt;
    &lt;/div&gt;
    &lt;!-- &lt;button type='button' class='btn btn-default' data-toggle="modal" data-target="#imageupload" (click)="resetCropper()"&gt;Upload Image&lt;/button&gt; --&gt;
    &lt;span class="img-selected" *ngIf="isImageselected"&gt;
      &lt;i class="fa fa-check main-content__checkmark success" id="checkmark"&gt;&lt;/i&gt;Image sel/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>the <strong>component.ts</strong> code below is for uploading a single image.</p>
  
  <pre><code>handleFiles = function (fileInput: Event) {
    this.imageArr = ['image/jpeg', 'image/jpg', image / png','image / gif'];
  
    if (fileInput.target['files'][0]['size'] &gt; 1024000) {
      $.growl.error({ title: 'Error', message: "File can not be larger than 1 MB" });
      return;
    }
    if (!this.imageArr.includes(fileInput.target['files'][0]['type'])) {
      $.growl.error({ title: 'Error', message: "Invalid file format." });
      return;
    }
  
    var file: File = fileInput.target['files'][0];
  
    this.extention = file.name.substr((file.name.lastIndexOf('.') + 1)).toLowerCase();
    var reader = new FileReader();
    reader.onload = this._handleReaderLoaded.bind(this);
    reader.readAsBinaryString(fileInput.target['files'][0]);
  }
  
  _handleReaderLoaded(readerEvt) {
    var binaryString = readerEvt.target.result;
    this.base64textString = btoa(binaryString);
    this.attached_image = 'data:image/jpeg;base64,' + this.base64textString;
    if (this.attached_image) {
      this.flashMsg = "Image uploaded successfully!";
    }
  }
  </code></pre>
  
  <p>Please your help would be highly appreciated.</p>