open pdf file in browser window

Author Message

andre müller

Tuesday 15 January 2008 6:51:15 am

hello
i try to create a link to pdf file in the media section. the pdf file should be opened in a browser window. i managed to make the link work with: {$relateditem.data_map.file.content.filepath|ezroot()}, but this only works if i remove my .htaccess file.
can anybody help me with altering the .htaccess file so users can view pdf's. or even better: is there a better way to have users read pdf directly without downloading? thanks..

André R.

Tuesday 15 January 2008 12:33:51 pm

You should probably post the rewrite conditions / rules you use in you .htaccess file..

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

andre müller

Wednesday 16 January 2008 1:53:29 am

the commented-out lines are the original entries from a fresh install

#<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf)$">
<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html|pdf))$">
order allow,deny
allow from all
</FilesMatch>

and:

#RewriteRule !\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php
RewriteRule !\.(gif|jpe?g|png|css|js|html|pdf)$ index.php

with that it works, but i'm not really sure what it's exactly doing..is it allowing all pdfs to be accessed and not to be redirected to index.php? are there problems with that?

i think my problem is, that my pdf files are not in in a path that includes a pdf directory. they are in a folder called application..

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 15:12:50
Script start
Timing: Jan 18 2025 15:12:50
Module start 'layout'
Timing: Jan 18 2025 15:12:50
Module start 'content'
Timing: Jan 18 2025 15:12:51
Module end 'content'
Timing: Jan 18 2025 15:12:51
Script end

Main resources:

Total runtime0.8358 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.3438152.6250
Module start 'layout' 0.00560.0042 741.968839.4609
Module start 'content' 0.00970.8244 781.4297535.7344
Module end 'content' 0.83410.0016 1,317.164112.1641
Script end 0.8357  1,329.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4120160.0002
Check MTime0.00130.1596160.0001
Mysql Total
Database connection0.00070.086010.0007
Mysqli_queries0.783593.7485570.0137
Looping result0.00070.0806550.0000
Template Total0.799995.720.4000
Template load0.00210.252520.0011
Template processing0.797895.454520.3989
Template load and register function0.00020.020010.0002
states
state_id_array0.00120.147210.0012
state_identifier_array0.00100.118220.0005
Override
Cache load0.00170.2028210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.073520.0003
Fetch class attribute name0.00100.122340.0003
XML
Image XML parsing0.00090.109720.0005
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00080.0986170.0000
String conversion0.00000.001340.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/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: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs