function downloadURI(uri, name) { var link = document.createElement("a"); link.download = name; link.href = uri; link.click(); }