I am trying to use the execCommand SaveAs function to have a user click on a portion of an imagemap and then have the browser retrieve the target URL and save it to a specific file on the users harddrive. I can’t seem to make it work. Would appreciate any suggestions.
Here are the snippets I have been trying.
<script language=”JavaScript” type=”text/JavaScript”>
function openDownLoadPrompt(URL){
var window1=window. open(URL,’mywindow’,’width=600,height=500,screenX=
0,screenY=0,left=0,top=0,toolbar=yes,location=yes,
directories=yes,status=yes,menubar=yes,scrollbars=
yes,copyhistory=yes,resizable=yes’);
window1.document.execCommand(“SaveAs”,”1″,”test.html”);
}
</script>
<a href=”#” onClick=openDownLoadPrompt(“
Download Test </a>
============================
<script type=”text/javascript”>
function SaveAs(file){
if(document.execCommand){
document.execCommand(“SaveAs”,null,”Test.html”);
}
}
//–>
</script>
</head>
<body>
<A HREF=”