open binary stream of PDF in browser and NOT popup the Download dialog box
Hi,
I have an aspx page that streams binary data to the browser using the Response object, in the form of PDF by setting
Response.ContentType = "application/pdf";
Instead of opening acrobat reader in the browser itself, it pops up a dialog box prompting the user to open/save/cancel the .aspx file.
I did some research o it and found that the Acrobat Reader's setting must be changed to allow it to display in the browser and not try to download the file.
the setting is edit - preferences - options - Display PDF in browser.
I have checked this option and it still doesn't display in the browser window.
[If the response is a word doc, i.e., Response.ContentType = "application/msword";
everything works fine. The word document is nicely displayed inside the browser window.]
I'm wondering if there is anything that should be programmatically set to make the PDF open in browser and NOT popup the download dialog box.
I would really appreciate if anyone can point me in the right direction.
fragment of my code that streams the binary data.......
------------------------------------------------------------------
MemoryStream PageData = new MemoryStream();
byte[] PageBytes = null;
do
{
PageBytes = obPageStream.Read(32768) as byte[];
PageData.Write(PageBytes, 0, PageBytes.Length);
} while (PageBytes.Length > 0);
PageData.WriteTo(Response.OutputStream);
Response.Flush();
Response.Close();
--------------------------------------------------------------------
Thanks,
Srivalli.