Skip to content

Instantly share code, notes, and snippets.

@ronipl
Last active October 8, 2019 02:53
Show Gist options
  • Save ronipl/97102d3f08a3dcb5527e78752074f1ee to your computer and use it in GitHub Desktop.
Save ronipl/97102d3f08a3dcb5527e78752074f1ee to your computer and use it in GitHub Desktop.
Download html images based on file source array.
var files = [
"file.ext",
]
var i;
var targets_count = files.length;
for (i = 0; i < targets_count; i++) {
files[i]
var partsArr = files[i].split('/');
console.log(partsArr);
var a = jQuery("<a>").attr("href", files[i]).attr("download", ""+partsArr[5]+"").appendTo("body")[0];
a.click();
a.remove();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment