| Author |
Saving images using JS
|
Bob Backlund
Ranch Hand
Joined: Jun 05, 2003
Posts: 51
|
|
I am trying to create a page that displays a list of images, under each image is a link. When you click on this link I want the IE "Save File" dialog to popup asking the user to save the image to their machine. I've managed to get this bit to work but I can not get it to save the image, instead if tries to save the actual HTML of the page. My script code is as follows: function downloadImage(pid) { document.execCommand("SaveAs",null, IMAGE_NAME); } <a href="javascript ownloadImage('<%=pid%>')">Save Image</a> Any help would be appreciated
|
Cheers!
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56216
|
|
As this has nothing to do with JSP, I'm moving it along to the HTML/Javascript forum. bear
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Saving images using JS
|
|
|