To optimize file transfer, I recommend compressing all files into a single file on the server side and serving it that way.
If this is not feasible, you could use JavaScript to loop through the download links as shown below:
Assume you have a basic HTML setup with three download links.
<ul>
<li>
<input name="checkbox" value="/download1.jpg">Download Image 1
</li>
<li>
<input name="checkbox" value="/download2.jpg">Download Image 2
</li>
<li>
<input name="checkbox" value="/download3.jpg">Download Image 3
</li>
</ul>
<a href="#" onclick="downloadSelected()">Download</a>
Here is the corresponding JavaScript code. Please note that multiple popups may trigger browser warnings for users.
function downloadSelected() {
$('input[type=checkbox]:checked').each(function() {
window.open($(this).val());
});
return false;
}
You can see a working example in Plunker: http://plnkr.co/edit/0ERMZ4VyXzvE0iebGMfb