Last post Jan 30, 2007 01:53 AM by Zhao Ji Ma - MSFT
Jan 29, 2007 05:20 PM|luisetxe|LINK
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
Jan 30, 2007 12:38 AM|Zhao Ji Ma - MSFT|LINK
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-Disposition: attachment; filename="downloaded.pdf
Jan 30, 2007 12:52 AM|luisetxe|LINK
Although I didn't mention it, I am actually using Content-Disposition: attachment; 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.
Jan 30, 2007 01:53 AM|Zhao Ji Ma - MSFT|LINK
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.