I need to view and PDF file stored as an attachment inside an IFRAME in this context: Visualforce: Why the display of an PDF-File inside an IFRAME works on a Sandbox but not in Production?

Inspecting the Request-Header Details the server responds differently, but I can't understand why. Now I was able to nail down the exact difference, which is a different Content-Disposition header. I need it to be inline. On Sandbox I get Inline as desired but on Production I got Attachment which is very bad for what I want.

Here are the links:



gets rewritten to


The response header becomes

Content-Disposition inline; filename="FILENAME.pdf"



it does not get rewritten

and the response header becomes

Content-Disposition attachment; filename="FILENAME.pdf"


Anyone knows how this can be tweaked to take control and get always the header to be either Inline or Attachment as needed?

1 Answer 1


Have you checked the File Upload and Download Security settings under: Setup > Security Controls > File Upload and Download Security

There is a row for PDF files. I believe you will want to change the Download Behavior to "Execute in Browser" to force the browser to display the PDF rather than downloading and saving the file on your computer.

Salesforce File Upload and Download Security settings

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .