Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

download image from url javascript

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();
}
 
PREVIOUS NEXT
Tagged: #download #image #url #javascript
ADD COMMENT
Topic
Name
8+5 =