Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:54:21+00:00 2026-05-27T17:54:21+00:00

This one is killing me! In ASP Classic I’m trying to stream users a

  • 0

This one is killing me! In ASP Classic I’m trying to stream users a pdf file, so far i’ve got the following code:

Response.Buffer = False
'This is download
Response.ContentType = ContentTypeFromFile(DownloadFileName)
'Set file name
Response.AddHeader "Content-Disposition", "inline; filename=myfile.pdf#search=fox"
Response.binarywrite "c:/myfile.pdf"

However it’s not working and the ? and # are changed to _ when I run it which causes the file download to break.

I found the same question asked on here but it was 3 years ago and I’ve tried doing what the accepted answer suggested without any success.

Can anyone help me?

Link to the old question: https://stackoverflow.com/search?q=open+pdf+with+search

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:54:22+00:00Added an answer on May 27, 2026 at 5:54 pm

    Okay finally I worked this one out! The answer given in the other question is the actual answer, understanding it however was the tricky part!

    Have this code in your page:

    <%
    response.Clear
    
    Response.Buffer = False
    'This is download
    Response.ContentType = "application/pdf"
    'Set file name
    Response.AddHeader "Content-Disposition", "inline; filename=myfile.pdf"
    
    set stream = Server.CreateObject("ADODB.Stream")
    stream.Open
    stream.Type = 1 ' binary
    stream.LoadFromFile("c:\test.pdf")
    
    Response.BinaryWrite(stream.Read)
    
    Response.End()
    %>
    

    And then you pass the parameters to the adobe reader through the url! So if the code above is in a page called: default.asp

    then do this: http://www.yoururl.com/default.asp#search=fox&zoom=20&page=2

    and it will work a treat! Not in google chrome mind you! I googled about getting this sort of thing working in chrome however google didn’t code in parameters into their pdf viewer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This one is killing me. I'm trying to make a simple console app that
This one is killing me,i'm a total noob with regex. Im trying to make
This one is a bit tedious in as far as explaining, so here goes.
So this one is a doozie; I've got a pretty large OpenGL solution, written
I'm tearing my hair off my head on this one. Trying to parse this
This one is killing me... I'm learning to develop SOAP servers in PHP at
This one is killing me: echo preg_match(/([a-zA-Z0-9\-\.]+)\.([a-zA-Z0-9]+)/,'downcom'); This one print 0 , because it
I've been killing myself all day for this one bug. I can't tell you
Folks, this one is killing me.... I'm using jscrollpane in a lot of places
Ok this one is killing me. Maybe its late and I am forgetting something,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.