I’m currently trying to make a program where the user can select each image they want to download then download them without using any zip files. It currently works but it has to open a new window for every link. I was wondering if anybody had a better suggestion on how to do this without opening a window for every download, and is still relatively easy to set up? I’m currently using a download.php file from joomlaworks sigpro as an easy download solution by just pointing to it in the window url.
my code:
$('.finishselect').click(function(){
$( ".selected" ).each(function () {
var $href = $(this).parent().children('img').attr('src'),
$hrefShort = $href.replace('http://example.com/plugins/content/gallery/gallery/thumbs/', 'images\\Pics/');
window.open("/plugins/content/jw_sigpro/jw_sigpro/includes/download.php?file=" + $hrefShort);
});
});
You could use an iframe and set the iframe src to the download instead.
You could then clean up the iframes (e.g. remove them from the DOM) if you really wanted to, but you shouldn’t need to.