guardar imagenes con javascript
Muy buenas,necesito guardar imagenes desde javascript,no se si puede hacer esto de este modo o necesito hacer alguna rutina en java.
Esto te puede servir: (si hay alguien que conozca un método para Netscape que lo comente, please)
IE supports document.execCommand('SaveAs') to save the current page. It looks as if you can also open a page with an image in it and then call the command on the image page:
function saveImageAs (imgOrURL) {
if (typeof imgOrURL == 'object') imgOrURL = imgOrURL.src;
window.win = open (imgOrURL); setTimeout('win.document.execCommand("SaveAs")', 500);
}
<A HREF="javascript: void 0" ONCLICK="saveImageAs(document.anImage); return false" >save image</A>
<IMG NAME="anImage" SRC="whatever.gif">
IE supports document.execCommand('SaveAs') to save the current page. It looks as if you can also open a page with an image in it and then call the command on the image page:
function saveImageAs (imgOrURL) {
if (typeof imgOrURL == 'object') imgOrURL = imgOrURL.src;
window.win = open (imgOrURL); setTimeout('win.document.execCommand("SaveAs")', 500);
}
<A HREF="javascript: void 0" ONCLICK="saveImageAs(document.anImage); return false" >save image</A>
<IMG NAME="anImage" SRC="whatever.gif">