Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
strFile = request.QueryString("file")
strOne = "attachment; filename=" & strFile
strTwo = "docs/" & strFile ' this is the relative route to the folder where your download files are placed
Response.Buffer=true
On Error Resume Next
'Create a stream object
Dim tfm_downloadStream
Set tfm_downloadStream = Server.CreateObject("ADODB.Stream")
tfm_downloadStream.Type = 1
tfm_downloadStream.Open
tfm_downloadStream.LoadFromFile Server.Mappath(strTwo)
If Err.number = 0 Then
Response.Clear
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", strOne
Response.AddHeader "Content-Transfer-Encoding","binary"
Response.BinaryWrite tfm_downloadStream.Read
tfm_downloadStream.Close
Set tfm_downloadStream = Nothing
Response.End()
Else
tfm_downloadStream.Close
Set tfm_downloadStream = Nothing
Response.Redirect("oops.asp")
End If
%>
<a href="download.asp?strFile=mySpreadsheet.xls">Link</a>