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