title: How to add/remove button for multiple uploaded files?
body: <p>I want to add remove button for remove image thumbnail and selected file. How can i do it? This is my code</p>
  
  <p><strong>Js:</strong></p>
  
  <pre><code>window.imagePreview = function (t) {
      if (t.files &amp;&amp; t.files[0]) {
          for (var i = 0; t.files.length &gt;= i; i++) {
              var reader = new FileReader();
              reader.onload = function (e) {
                  $('#image-preview').append('&lt;img src="' + this.result + '"/&gt;');
              };
  
              reader.readAsDataURL(t.files[i]);
          }
      }
  }
  </code></pre>
  
  <p><strong>CSS</strong>:</p>
  
  <pre><code>.btn-file{
      position: relative;
  }
  .btn-file input[type=file] {
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      left: 0;
      opacity: 0;
  }
  
  #image-preview {
      width: 100%;
      max-height: 260px;
      height: 260px;
      overflow-y: auto;
      background-color: #F0F0F0;
      border: 1px dashed #928f8f;
      border-radius: 4px;
      margin-bottom: 10px;
  }
  
  
  #image-preview img {
      max-width: 120px;
      max-height: 120px;
      display: inline-block;
      margin: 5px;
  }
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"/&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="image-preview"&gt;&lt;/div&gt;
    &lt;span class="btn btn-primary btn-file"&gt;
      &lt;input type="file" name="file[]" id="file" class="" multiple onchange="imagePreview(this)" style="width: 0;height: 0;"&gt;
        Select Files
    &lt;/span&gt;
  </code></pre>
  
  
  
  <p><a href="https://jsfiddle.net/sgjp2aqL" rel="nofollow noreferrer"><strong>JSfiddle</strong></a></p>
  
  <p>And how fix this error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'</p>
  </blockquote>