Forums / General / Access to pdf file

Access to pdf file

Author Message

narilalaina fabrice

Wednesday 03 November 2010 8:24:44 am

Hi all

I tried to access to a pdf file with <a href="{'/var/pdfDirectory/mypdf.pdf'|ezroot(no)}">my pdf</a>

but I got :"Forbidden You don't have permission to.."

I already gave full grant to the directory

Thks

Heath

Wednesday 03 November 2010 8:40:50 am

Hello narilalaina,

Welcome to the eZ Community!

It appears you have a webserver configuration error.

Cheers,

Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Christian Rößler

Wednesday 03 November 2010 9:14:34 am

Hy,

please check your ".htaccess" file which should reside in the ezpublish installation directory right beside index.php .
Locate the lines which might reflect access restrictions to folders under /var/... and/or filetypes.
If you are using the stock htaccess-root file, change the following lines

...
<FilesMatch "(^index\.php|favicon\.ico|index_treemenu\.php|\.(gif|jpe?g?|png|css|js|swf|html?|jar)|var(.+)storage.pdf(.+)\.pdf)$">
...
RewriteRule !(\.(gif|jpe?g?|png|css|js|swf|html?|jar)|var(.+)storage.pdf(.+)\.pdf)$ index.php
... 

to

...
<FilesMatch "(^index\.php|favicon\.ico|index_treemenu\.php|\.(gif|jpe?g?|png|css|js|swf|html?|jar|pdf)|var(.+)storage.pdf(.+)\.pdf)$">
...
RewriteRule !(\.(gif|jpe?g?|png|css|js|swf|html?|jar|pdf)|var(.+)storage.pdf(.+)\.pdf)$ index.php 

But of course you can and should use a more specific rule other than globally enable access to pdf-files like I did above. Please ensure not to open (in terms of security) your server. Also make sure to understand the terms above before adding them to your server.

Of course it might be possible, that "Access denied" comes from a complete other source and the stuff above is not the cure.

cheers,

chris

Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613

eZ debug

Timing: Jan 18 2025 03:08:34
Script start
Timing: Jan 18 2025 03:08:34
Module start 'content'
Timing: Jan 18 2025 03:08:35
Module end 'content'
Timing: Jan 18 2025 03:08:35
Script end

Main resources:

Total runtime0.7286 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 593.1563180.8594
Module start 'content' 0.00640.6291 774.0156573.9609
Module end 'content' 0.63550.0930 1,347.9766332.7656
Script end 0.7284  1,680.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.5693210.0002
Check MTime0.00160.2166210.0001
Mysql Total
Database connection0.00090.123110.0009
Mysqli_queries0.664291.16921960.0034
Looping result0.00160.21391940.0000
Template Total0.702996.520.3515
Template load0.00190.254020.0009
Template processing0.701196.225720.3505
Template load and register function0.00010.019110.0001
states
state_id_array0.00080.106510.0008
state_identifier_array0.00080.103920.0004
Override
Cache load0.00150.2081270.0001
Sytem overhead
Fetch class attribute can translate value0.00100.133340.0002
Fetch class attribute name0.00110.155240.0003
XML
Image XML parsing0.00120.163140.0003
class_abstraction
Instantiating content class attribute0.00000.001440.0000
General
dbfile0.00530.7214280.0002
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
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
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs