eZ Community » Forums » Setup & design » Unable to retrieve file link throught...
expandshrink

Unable to retrieve file link throught content/download module in default siteaccess

Unable to retrieve file link throught content/download module in default siteaccess

Sunday 18 September 2011 11:27:02 am - 5 replies

Hello,

Using the default file class, i'm getting a 404 error when i try to download PDF using the front-end siteacess, to be more precise :

http://www.studio-m.dev/a/content.../1513/version/3/file/inscription.pdf is working (a is the admin' siteaccess)
http://www.studio-m.dev/content/d.../1513/version/3/file/inscription.pdf gives a 404

I'm generating the url that way :

 {def $fiche_inscription=fetch('content','node', hash('node_id',130))}
        <li>
 
        {def $urlpdf=concat( '/content/download/', $fiche_inscription.data_map.file.contentobject_id, '/', $fiche_inscription.data_map.file.id,'/version/', $fiche_inscription.data_map.file.version , '/file/', $fiche_inscription.data_map.file.content.original_filename|urlencode )}
        <a href={$urlpdf|ezurl()}>
            {attribute_view_gui attribute=$fiche_inscription.data_map.image image_class='original'}
        </a>
        </li>
        {undef $fiche_inscription $urlpdf}

Sorry if this question has already been answered, i did not find where happy.gif Emoticon

More info : i'm using the last release of eZPublish (2011.8), running on development  environment (wamp, php 5.3), multi-site/multi-lang project (french/english)

I've also added anonymous access to "content/read" (and content version_read) in media section
I tryed to give full access and got 404 too.

Thanks happy.gif Emoticon

Modified on Sunday 18 September 2011 12:23:48 pm by Stéphane Le Merre

Sunday 18 September 2011 6:53:48 pm

Does the user have proper permissions? I mean have you tried to first login as admin in frontend siteaccess before accessing the link?

Even if the user knows the download link it needs to have permission to read that content node, maybe you'll need to give the right permission to the anonymous user.

Modified on Sunday 18 September 2011 6:59:51 pm by Thiago Campos Viana

Monday 19 September 2011 7:59:40 am

If it were a permissions issue you should be getting a login prompt instead of a 404.

Since you appear to be using a default access and not including the siteaccess name in the URL, check that the following is present in your settings/override/site.ini.append.php:

[SiteSettings]
DefaultAccess=<your_access>

And in settings/siteaccess/<your_access>/site.ini.append.php:

[SiteAccessSettings]
RemoveSiteAccessIfDefaultAccess=enabled

Modified on Monday 19 September 2011 8:01:02 am by Daniel A. Øien

Monday 19 September 2011 9:00:33 pm

First, thanks for answering : i'm pretty sure anonymous users have the proper permissions, and i do not access this file when i connect admin user to the frontend app also. This did not give result :

content read No limit

Daniel, i got this configuration, but not in override settings, because i need to have many domains on this install. The rootnode of this website is not 2, but 59, this looks like :

2 - main node

  • 59 : www.studio-m.dev (width 2 siteaccess studiom_fr and studiom_en)
  • 60 : www.example.com (width 2 siteaccess example_fr and example_en)
  • 61 : www.example2.com (width 2 siteaccess example_fr and example_en)

And in my override settings :

HostUriMatchMapItems[]=www.studio-m.dev;en;studiom_en
HostUriMatchMapItems[]=www.studio-m.dev;fr;studiom
#etc...

to get urls like :

www.studio-m.dev for french version and www.studio-m.dev/en/ for each domain.

I confirm i have an "Object is unavailable" message, and no login form is prompt.

Modified on Monday 19 September 2011 9:01:11 pm by Stéphane Le Merre

Tuesday 20 September 2011 9:21:59 pm

I feel a bit stupid, i changed the varDir directory of my frontend siteaccess in FileSettings without changing the varDir of the admin... problem is now solved.

Is there a way to assign a different varDir in a siteaccess depending on tree ? (or must i have the same varDir for each siteaccesses of my domains ?)

Tuesday 20 September 2011 10:33:22 pm

Sometimes, the best solutions are the ones you come up with yourself happy.gif Emoticon

To your question - as far as I know, siteaccesses using the same database must share the same varDir.

Depending on your exact requirements, the overview from this tutorial may help:

http://share.ez.no/learn/ez-publish/lots-of-websites-one-ez-publish-installation-adding-siteaccesses-in-ez-publish/(page)/2

Modified on Tuesday 20 September 2011 10:34:25 pm by Daniel A. Øien

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from