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

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 11:41:45
Script start
Timing: Jan 18 2025 11:41:45
Module start 'layout'
Timing: Jan 18 2025 11:41:45
Module start 'content'
Timing: Jan 18 2025 11:41:46
Module end 'content'
Timing: Jan 18 2025 11:41:46
Script end

Main resources:

Total runtime0.7287 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 587.9063152.6250
Module start 'layout' 0.00560.0031 740.531339.4531
Module start 'content' 0.00880.7184 779.9844534.7266
Module end 'content' 0.72720.0015 1,314.710912.4844
Script end 0.7287  1,327.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4315160.0002
Check MTime0.00130.1763160.0001
Mysql Total
Database connection0.00090.129110.0009
Mysqli_queries0.677192.9225570.0119
Looping result0.00060.0812550.0000
Template Total0.696195.520.3481
Template load0.00190.262120.0010
Template processing0.694295.267120.3471
Template load and register function0.00020.023210.0002
states
state_id_array0.00070.094010.0007
state_identifier_array0.00110.156220.0006
Override
Cache load0.00160.2182250.0001
Sytem overhead
Fetch class attribute can translate value0.00140.188720.0007
Fetch class attribute name0.00130.177740.0003
XML
Image XML parsing0.00070.094020.0003
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00140.1933160.0001
String conversion0.00000.001240.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
7content/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
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs