There's this Excel file I want users to be able to download from my server. There must be an easy way to initiate the download of the file after a click on the "Download" button... but I have no clue how to make that happen.
I have this so far: (VBscript and ASP)
<head>
<script type="text/javascript" src="overzicht.js"></script>
</head>
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if (fs.FileExists("c:\file.xls"))=true then 'fake filename D:
response.write("<input type='button' value='Download Masterfile' class='button' onclick='exportmasterfile();' /><br />")
else
response.write("Masterfile not found. <br />")
end if
set fs=nothing
The javascript function is empty.
Actually, if you want a 'more-efficient' (and sexier) way, use:
location.href = your_url;
That way, you will save the compiler some time in going up to the location
's prototype chain up to the window
object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With