Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>
- <%= Request.QueryString("File") & ".PDF" %>
- </title>
- </head>
- <body>
- <%
- Server.Transfer "loadfileAfter.asp"
- %>
- </body>
- </html>
- Response.ContentType = "application/pdf"
- Response.AddHeader "content-disposition", "Filename=" & Request.QueryString("File") & ".PDF"
- Const adTypeBinary = 1
- strFilePath = "D:" & Request.QueryString("File") & ".PDF" 'This is the path to the file on disk.
- Set objStream = Server.CreateObject("ADODB.Stream")
- objStream.Open
- objStream.Type = adTypeBinary
- objStream.LoadFromFile strFilePath
- Response.BinaryWrite objStream.Read
- objStream.Close
- Set objStream = Nothing
- Response.AddHeader "content-disposition", "Filename=" & Request.QueryString("File") & ".PDF"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement