function download(source){ const fileName = source.split('/').pop(); var el = document.createElement("a"); el.setAttribute("href", source); el.setAttribute("download", fileName); document.body.appendChild(el); el.click(); el.remove(); }