Hello everyone.
I have a number of images on my web page which are dynamically displayed. The user wants to be able to have a button that when slicked will prompted them to do a save.
I've tried using execCommand("SaveAs") but for some reason it seems to be inconsistent the was I have it now.
function SaveAsImage(obj)
{
newWindow = window.open(obj,"SaveImage","directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes, top=100000,left=100000, width=0, height=0");
newWindow.document.execCommand("SaveAs");
newWindow.close();
return false;
}
"obj" is a relative path of to the image (../../images/picture.jpg)
Some times the prompt has the name of the image and saves it properly. Other times it just says undefined.
If anyone have any suggestions for me that would be great.
Thanks.
I have a number of images on my web page which are dynamically displayed. The user wants to be able to have a button that when slicked will prompted them to do a save.
I've tried using execCommand("SaveAs") but for some reason it seems to be inconsistent the was I have it now.
function SaveAsImage(obj)
{
newWindow = window.open(obj,"SaveImage","directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes, top=100000,left=100000, width=0, height=0");
newWindow.document.execCommand("SaveAs");
newWindow.close();
return false;
}
"obj" is a relative path of to the image (../../images/picture.jpg)
Some times the prompt has the name of the image and saves it properly. Other times it just says undefined.
If anyone have any suggestions for me that would be great.
Thanks.