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.

eZ debug

Timing: Jan 18 2025 11:19:34
Script start
Timing: Jan 18 2025 11:19:34
Module start 'layout'
Timing: Jan 18 2025 11:19:34
Module start 'content'
Timing: Jan 18 2025 11:19:35
Module end 'content'
Timing: Jan 18 2025 11:19:35
Script end

Main resources:

Total runtime0.7024 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.0547152.6250
Module start 'layout' 0.00660.0041 741.679739.4453
Module start 'content' 0.01070.6903 781.1250546.8281
Module end 'content' 0.70100.0014 1,327.953112.4688
Script end 0.7024  1,340.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4865160.0002
Check MTime0.00140.2010160.0001
Mysql Total
Database connection0.00110.157910.0011
Mysqli_queries0.651092.6824620.0105
Looping result0.00060.0873600.0000
Template Total0.669095.220.3345
Template load0.00210.303820.0011
Template processing0.666994.939920.3334
Template load and register function0.00020.031010.0002
states
state_id_array0.00080.119710.0008
state_identifier_array0.00070.103120.0004
Override
Cache load0.00180.2576220.0001
Sytem overhead
Fetch class attribute can translate value0.00050.068230.0002
Fetch class attribute name0.00120.170550.0002
XML
Image XML parsing0.00080.116230.0003
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00080.1074160.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs