Created
May 25, 2015 12:00
-
-
Save IOZ/25a7f705918511c345b3 to your computer and use it in GitHub Desktop.
Auto downloading files via js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function downloadURI(uri, name) | |
{ | |
var link = document.createElement("a"); | |
link.download = name; | |
link.href = uri; | |
link.click(); | |
} | |
var arr = []; // array with files | |
var link = 'url'; | |
for(var i = 0; i<arr.length; i++) { | |
downloadURI(link+arr[i]+'.gif', arr[i]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment