1
Problem
How do I download several images with javascript?
For example, how do I when I click on a javascript button it automatically accesses url: http://www.bing.com/az/hprichbg/rb/FrenchSunset_PT-BR10590691175_1366x768.jpg and download the image?
HTML
<button onclick="salvar_imagem()">Salvar Imagem</button>
JAVASCRIPT
<script>
function salvar_imagem(){
// ir em http://www.bing.com/az/hprichbg/rb/FrenchSunset_PT-BR10590691175_1366x768.jpg e baixar a imagem
}
</script>
I have no idea how to do that.
Observing
If this is not possible to do in JavaScript
could someone give me a hint as to how it is done in PHP
?
You want to save this where? On client or server?
– André Leria
On the same customer :)
– Silvio Andorinha
I won’t answer for lack of experience, but I know you can’t save directly on the customer, but there are workarounds. It has the Html5 File System API, or if you want to go further, you can make a client desktop application that obeys a protocol to download it.
– André Leria