Problem with direct linking to a binary file

Author Message

Maarten Holland

Tuesday 28 September 2004 11:48:47 pm

Hi all,

Can anyone tell me if it is possible to link directly to a binary file from one of my template overrides? I get an URL like http://mysite.com:2075/index.php/content/download/167/487/file/myuploadedfile.pdf but that only works from the admin interface. When I change the port to my user access, it says 'Object not available'.

After this, I have another problem: I tried to show which templates are being used in the admin interface, so I can see what code they use. To do this, I've added the following to site.ini.append.php:

[ContentSettings]
TranslationList=
ViewCaching=disabled

[TemplateSettings]
Templatecache=disabled
Templatecaching=disabled
AutoloadPath=lib/eztemplate/classes/;kernel/common/
Debug=enabled
NodeTreeCaching=disabled
ProcessCaching=disabled

[OverrideSettings]
Cache=disabled

[DebugSetttings]
DebugByIP=disabled
Debug=inline
DebugRedirection=disabled

After which I see the templatenames, but when I try to open any page in the content part of the admin interface, I get an error or just the page without my content.

Does anyone know how I can solve these 2 problems?

Thank you for your help,

Maarten

Nicolas Heiringhoff

Wednesday 29 September 2004 1:21:21 am

Hello Maarten,

we use this code to link directly to an pdf file, that can be uploaded with an article.
I do not know if you try to this, or if your binary file is some kind of static.
Maybe the code helps.



{* Fetch everything that is under node #296 (children, grand-children, etc.) *}
{let nodes=fetch( 'content', 'tree', hash( 'parent_node_id', 296 ) ) }

{* Loop through the nodes and display their names. *}
{section loop=$nodes}


<br />

{$:item.data_map.titel.data_text}

<br />

{$:item.data_map.beschreibung.data_text}

<br />

<a href={concat("content/download/",
$:item.object.id,
"/",
$:item.object.data_map.file.id,
"/file/",
$:item.object.data_map.file.content.original_filename)|ezurl}>
{$:item.object.name|wash}</a>

<br />
{/section}



{/let}

 

Nico

http://www.heiringhoff.de

paul bolger

Wednesday 25 April 2007 7:40:00 pm

Not sure about the $:variable stuff - but I've only been around eZ for the past eight months or so. Here's what worked for me in 3.86:

<a href={concat

("content/download/",
$related.main_node.object.id,
"/",
$related.main_node.data_map.file.id,
"/file/",
$related.main_node.data_map.file.content.original_filename
)
|ezurl}>

{$related.main_node.name|wash}
 {'application/pdf'|mimetype_icon( small, "Download PDF"|i18n( "design/base" ) )}</a> (pdf file)

Adding a filesize would be cute - later!

Paul Bolger

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 31 2025 06:29:38
Script start
Timing: Jan 31 2025 06:29:38
Module start 'layout'
Timing: Jan 31 2025 06:29:38
Module start 'content'
Timing: Jan 31 2025 06:29:39
Module end 'content'
Timing: Jan 31 2025 06:29:39
Script end

Main resources:

Total runtime0.8835 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0039 588.2656151.2266
Module start 'layout' 0.00390.0024 739.492236.6797
Module start 'content' 0.00630.8765 776.1719981.0391
Module end 'content' 0.88280.0007 1,757.210911.8125
Script end 0.8835  1,769.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00260.2986160.0002
Check MTime0.00110.1269160.0001
Mysql Total
Database connection0.00060.063710.0006
Mysqli_queries0.825393.4145590.0140
Looping result0.00050.0591570.0000
Template Total0.849396.120.4246
Template load0.00200.221620.0010
Template processing0.847395.900020.4236
Template load and register function0.00160.181910.0016
states
state_id_array0.00210.241310.0021
state_identifier_array0.00160.186220.0008
Override
Cache load0.00170.1907400.0000
Sytem overhead
Fetch class attribute can translate value0.00040.043830.0001
Fetch class attribute name0.00170.192850.0003
XML
Image XML parsing0.00330.377530.0011
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.00290.3235220.0001
String conversion0.00000.000440.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
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs