Configuring HBase as standalone (using local file system) Is brain multicore?
Mar 26

<script>
function saveImageAs (imgOrURL) {
if (typeof imgOrURL == ‘object’)
imgOrURL = imgOrURL.src;
window.win = open (imgOrURL);
setTimeout(’win.document.execCommand(”SaveAs”)’, 500);
}
</script>

<A href=”#”
ONCLICK=”saveImageAs(document.getElementById(’embedImage’)); return false” >save image</A>

<img id=”embedImage” src=”impossible.jpg” >
I am not the author of this code and i am really not sure where i picked up this script. But it works too good… only on IE

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • description
  • Furl
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis

Tags:

2 Responses to ““Save Image As” without Right Click using Javascript”

  1. DSDexigns » Blog Archive » How to: Prompt out the ‘SAVE AS’ Says:

    [...] <script> function saveImageAs (imgOrURL) { if (typeof imgOrURL == ‘object’) imgOrURL = imgOrURL.src; window.win = open (imgOrURL); setTimeout(’win.document.execCommand(”SaveAs”)’, 500); } </script> <A href=”#” onclick=”saveImageAs(document.getElementById(’embedImage’)); return false” >save image</A> <img id=”embedImage” src=”IMAGEFILE.JPG”> Source: http://www.arunma.com [...]

  2. Jay Says:

    add
    setTimeout(’win.close()’, 500);
    after
    setTimeout(’win.document.execCommand(”SaveAs”)’, 500);
    so that the popup page closes automatically after saving.

Leave a Reply

Give your best to the world.