title: (Javascript) How to force the download of an image using iframe?
body: <p>My requirement is to select a bunch of images and download them all, all at the same time.</p>
  
  <p>I'm using this library (<a href="https://github.com/biesiad/multiDownload" rel="nofollow">https://github.com/biesiad/multiDownload</a>) that works pretty well with other files than iamges. When it is image, it doesn't work.</p>
  
  <p>My conclusions is that the browser perceives images differently from other binary files.</p>
  
  <p>I've checked on Google Chrome and all the files that work using that plugin, they are cancelled (developer tools > network) but the images aren't.</p>
  
  <p>Is there any way to tell browser that it's a binary like all the other files? Is there any way?</p>
  
  <p>Many thanks</p>
  
  <hr>
  
  <p>The function is implemented like that:</p>
  
  <pre><code>var methods = {
      _download: function (options) {
          var triggerDelay = (options &amp;&amp; options.delay) || 100;
          var cleaningDelay = (options &amp;&amp; options.cleaningDelay) || 1000;
  
          this.each(function (index, item) {
              methods._createIFrame(item, index * triggerDelay, cleaningDelay);
          });
          return this;
      },
  
      _createIFrame: function (item, triggerDelay, cleaningDelay) {
          setTimeout(function () {
              var frame = $('&lt;iframe style="display: none;" ' +
                            'class="multi-download-frame"&gt;&lt;/iframe&gt;');
              frame.attr('src', $(item).attr('href') || $(item).attr('src'));
              $(item).after(frame);
              setTimeout(function () { frame.remove(); }, cleaningDelay);
          }, triggerDelay);
      }
  };
  
  $.fn.multiDownload = function(options) {
      return methods._download.apply(this, arguments);
  };
  </code></pre>