Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. <%= Request.QueryString("File") & ".PDF" %>
  5. </title>
  6. </head>
  7. <body>
  8.  
  9. <%
  10.  
  11. Server.Transfer "loadfileAfter.asp"
  12.  
  13. %>
  14. </body>
  15. </html>
  16.  
  17. Response.ContentType = "application/pdf"
  18. Response.AddHeader "content-disposition", "Filename=" & Request.QueryString("File") & ".PDF"
  19. Const adTypeBinary = 1
  20.  
  21.  
  22. strFilePath = "D:" & Request.QueryString("File") & ".PDF" 'This is the path to the file on disk.
  23.  
  24. Set objStream = Server.CreateObject("ADODB.Stream")
  25. objStream.Open
  26. objStream.Type = adTypeBinary
  27. objStream.LoadFromFile strFilePath
  28.  
  29. Response.BinaryWrite objStream.Read
  30.  
  31. objStream.Close
  32. Set objStream = Nothing
  33.  
  34. Response.AddHeader "content-disposition", "Filename=" & Request.QueryString("File") & ".PDF"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement