Can anyone please help me with the following..
I have a need to offer users ability to download a document which, after reading thro' the web, I managed to achieve (no mean feat for a relative newbie to all things web) but what I do at present is link to this page from elsewhere and once the user completes the download it leaves a blank page on screen. To avoid this, I am informed after browsing the javascript forum, I need to link directly to the file rather than to a page but I've no idea how to do this. can anyone point out how to achieve this, if it the correct way to do it or otherwise..
I have a need to offer users ability to download a document which, after reading thro' the web, I managed to achieve (no mean feat for a relative newbie to all things web) but what I do at present is link to this page from elsewhere and once the user completes the download it leaves a blank page on screen. To avoid this, I am informed after browsing the javascript forum, I need to link directly to the file rather than to a page but I've no idea how to do this. can anyone point out how to achieve this, if it the correct way to do it or otherwise..
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
path="C:\WhatEverPathIsUsed\test.doc"
set fso=Server.CreateObject("Scripting.FileSystemObject")
set f=fso.OpenTextFile(path)
data=f.ReadAll
ext=fso.GetExtensionName(path)
if ext="pdf" then
Response.ContentType="application/pdf"
elseif ext="doc" then
Response.ContentType="application/msword"
'Response.AddHeader "Content-Disposition"," attachment; filename=" & "test.doc"
If Request.QueryString("ID")="Business" Then 'Allow Download Of Business Proposal
Response.AddHeader "Content-Disposition"," attachment; filename=" & "rc_companyproposal.doc"
Response.BinaryWrite data
ElseIf Request.QueryString("ID")="Consumer" Then 'Allow Download Of Consumer Proposal
Response.AddHeader "Content-Disposition"," attachment; filename=" & "rc_consumerproposal.doc"
Response.BinaryWrite data
End IF
End if
Set f = Nothing
Set fso = Nothing
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<BODY>
</body>
</html>