How To Create A Link For "save Image As" To Download an Image In Rails

Posted by Kuya on Stack Overflow See other posts from Stack Overflow or by Kuya
Published on 2010-04-05T08:40:37Z Indexed on 2010/04/05 8:43 UTC
Read the original article Hit count: 195

Filed under:
|

I want to make a link download like this

http://idwallpaper.com/download.php?image_id=1517

I have tried on other tutorial like this

<script>
function SaveFile(fname){
img.document.execCommand('saveas', null ,fname)
}
</script>


<iframe id="img" src="myimage.jpg" width="(image width + 20)px" height="(image height + 25)px" scrolling="no" frameborder="0px"></iframe>



<button onclick="SaveFile('myimage.jpg');">save as</button>

Does not work in FireFox though.....

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about html