Forums / Developer / Problems with pdf files

Problems with pdf files

Author Message

Romain Bremaud

Thursday 14 October 2010 1:30:49 am

I have a problem with pdf files. I have a class which possess a file attribute. The problems is : eZ-publish store the pdf like that : 0f3e8f9643b42cba9fd054660858a1a8.pdf

When I navigate on the web application this last one propose to download the pdf file with this url : http://my_site.com/index.php/file/download/2837 . I would like to have the following one url :

http://my_site/index.php/var/my_site/storage/original/application/my_file.pdf

Has anybody have an idea?

Romain Bremaud
Les clefs du net

Elena Ivanova

Thursday 14 October 2010 5:38:08 am

Hello Romain,

I would suggest to use:

{$node.data_map.file|attribute(show)}

for file (binary) attribute details. I think that to fetch original file, you can use

{$node.data_map.file.content.filepath|ezroot}

Hope this helps,

Elena

Romain Bremaud

Thursday 14 October 2010 6:54:05 am

Thanks for your answer Helena.

I found a solution for my problem. Before I have this script :

"

href={concat("file/download/",$node.node_id)|ezurl}

"

I replaced by that :

"

href={concat("content/download/",$node.data_map.file.contentobject_id,"/",$node.data_map.file.id,"/file/",$node.data_map.file.content.original_filename)|ezurl('no')}

"

With that the application propose to download the file directly.

Romain Bremaud
Les clefs du net