Entry
How do I give a user an option to either download a file to the Hard drive orOpen the file javascrit
Mar 4th, 2005 03:07
TeraZen, sreeni chetty,
As far as I know, you can't force a user to download a file! JavaScript
is a restrictive language, that can "suggest" things to browser users,
but not force them!
Oops... I'm sorry! :) I didn't understand the question ;-) (was tired
this day :-P)
Just call a function that change the page location on the OnClick event
of a form button... Here's a sample code you can paste in a .html file;
<html>
<head><title>Test</title></head>
<script language="JavaScript">
<!-- Begin
function OpenFile() {
}
// End -->
</script>
</head>
<body>
<form name="myform">
<input type=button onClick="OpenFile()" value="Open File">
</form>
</body>
</html>