SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently using WSS 3.0 and I am using page viewer web part to display a PDF file though when the page loads, users are prompted with the file download box to open or save the file.

Running Internet Explorer 8.

How can I get the PDF File to display without the File Download prompt?

share|improve this question

To open pdf file in browser use this code

                        WebClient client = new WebClient();
                        Byte[] buffer = client.DownloadData("address of pdf file");
                        Response.ContentType = "application/pdf";
                        Response.AddHeader("content-length", buffer.Length.ToString());
share|improve this answer
Thank you for the code though where do I insert it? The PDF file is currently viewed via Page Viewer webpart. – Marina Nov 19 '12 at 12:43
Hi Marina no idea how you can done with page view webpart but you can do it with CEWP Please check this link – Vishal_Sharepoint Nov 19 '12 at 13:20

Please check if MiME type (Pdf) are added to the IIS . By default,it will be blocked to open directly in SharePoint .

If it happens only for specific users then it must be IE Settings .

Thanks, Aravind.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.