Title in a HTTPHandler generated window. How to... RRS feed

  • Question

  • User692074111 posted


    I am using a HTTPHandler to display PDF files. I am popping up a window and then redirecting it to the HTTPHandler. ( There, I use Response.ContextType="application/pdf").

    I have noticed that the window generated by this handler has the path and name of my HTTPHandler as title.
     Since the ContextType is not text/html, it seems like I cannot add HTML code to change the title of the window.

    How can I change the title of the window to a more friendly one ( i.e the name of the PDF file, or a generic title ?)

     Suggestions welcomed. Thanks



    Monday, January 29, 2007 5:20 PM

All replies

  • User113421904 posted


    Do you want to change the title of your browser window.


    If you only set ContextType, i think you just streaming the pdf file.


    Try add following http header and more:

    Content-Dis; filename="downloaded.pdf


    Tuesday, January 30, 2007 12:38 AM
  • User692074111 posted


    Although I didn't mention it,  I am actually using Content-Dis; filename [my file]

     With or without it, the title bar of the browser window opened is still the full path and filename of my handler. I still cannot figure out the way to do it.

     Thanks anyway.

    Tuesday, January 30, 2007 12:52 AM
  • User113421904 posted


    How do you generate pdf files? Do you map *.pdf extension to your http handler, then when user access URL like:  http://localhost/sample.pdf, the sample.pdf doesn't actually need exist under the virtual directory, the pdf handler is called to dynamically generate the file, is it?

    Since browser call Adobe pdf ActiveX to load pdf, so I'm wondering if the Adobe PDF component just set the URL as the window title.

    Tuesday, January 30, 2007 1:53 AM