[http] Download multiple files with a single action

I am not sure if this is possible using standard web technologies.

I want the user to be able to download multiple files in a single action. That is click check boxes next to the files, and then get all the files that were checked.

Is it possible - if so what basic strategy do you recommend. I know I can use comets technology to create server side events that trigger an HttpResponse but I am hoping there is a simpler way.

This question is related to http web-applications download

The answer is

var links = [_x000D_
function downloadAll(urls) {_x000D_
  var link = document.createElement('a');_x000D_
  link.setAttribute('download', null);_x000D_
  link.style.display = 'none';_x000D_
  for (var i = 0; i < urls.length; i++) {_x000D_
    link.setAttribute('href', urls[i]);_x000D_
<button onclick="downloadAll(window.links)">Test me!</button>

Similar questions with http tag:

Similar questions with web-applications tag:

Similar questions with download tag: