PDF documemnts in browser window

Author Message

Martynas Bilevičius

Wednesday 13 August 2008 1:12:25 am

Hello,
Is two ways to display PDF document (not only PDF also ms word ...) like attachment or can download it. It is some settings in ez4 there can set it, then user open PDF document its open in same window or download it like attachment.

Gabriel Finkelstein

Thursday 21 August 2008 11:58:47 am

It will depend on the users browser setting. Some settings will open the document inside the browser, others will open it in with an external program (Acrobat or Word), and others will download it.
You cannot choose which one it is. Although you can force the browser to always download the file instead of using the browsers default behaviour. Which is what eZ does.

Felix Leimbach

Saturday 04 April 2009 9:18:20 am

You say that eZP forces the browser to download the file instead of using the browser's default behaviour. How can we turn that off?

Felix Leimbach

Saturday 04 April 2009 9:41:10 am

OK guys, figured it out myself. In case anyone else needs this:

the config file settings/file.ini has an (undocumented ...) section, where you can associate a content-disposition method [1] for mime-types. I.e. you can specify that PDFs should be displayed in the browser. Works only if the browser can handle that type of file (i.e. has a PDF-plugin installed).

The section looks like this and can be overriden in an override-template:

[PassThroughSettings]
# The default value for mime types not specified using ContentDisposition
# is "attachment". Possible values are attachment or inline.
ContentDisposition[application/x-shockwave-flash]=inline

Cheers,
Felix

[1] http://www.ietf.org/rfc/rfc2183.txt

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.