<% Option Explicit %> <% Response.ExpiresAbsolute = Now() - 1 '<<<<<DECLARATION OF ALL VARIABLES>>>>>' Dim sUserName Dim sPassword Dim sFileName Dim oMyObject '<<<<<OBTAIN ALL VARIABLES>>>>>' sUserName = Server.HTMLEncode(Request.Form("UserName")) sPassword = Server.HTMLEncode(Request.Form("Password")) sFileName = Server.HTMLEncode(Request.Form("FileName")) '<<<<<ENSURE VALID DATA FORMATS>>>>>' If Len(sUserName) > 0 AND Len(sPassword) > 0 Then If sFileName <> "" Then Dim vntStream Response.Buffer = TRUE Response.ContentType = "application/pdf" Set oMyObject = Server.CreateObject("MyObject.BinRead") vntStream = oMyObject.readBinFile("c:\webdocs\" & sFileName) Response.Addheader "Content-Disposition", "inline; filename=" & sFileName Response.CacheControl = "public" Response.BinaryWrite(vntStream) Set oMyObject = Nothing Response.End Else '<<<<<REDIRECT BLANK FILE NAMES>>>>>' Response.Redirect ("error_page.asp?01") End If Else '<<<<<REDIRECT BLANK USERNAME AND PASSWORDS>>>>>' Response.Redirect ("error_page.asp?02") End If %>