I am using the following code to download a database file from my server:
<html>
<head>
<title>Download</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<script language=”JavaScript”>
<!–
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+”.location='”+args[i+1]+”‘”);
}
//–>
</script>
</head>
<body bgcolor=”#FFFFFF” text=”#000000″ onLoad=”MM_goToURL(‘parent’,’test.mdb’);return document.MM_returnValue”>
Downloading …
</body>
</html>
**********
This works fine. However, I need to make the window close AFTER the download has finished. As it stands the user opens the page and the ‘Save’ or ‘Open’ dialogue pops up. They chose and it downloads. Once finished the window needs to close automatically.
I thought about a close on time delay, but this can’t be used because the duration of download will depend on file size and modem speed.
Any ideas?