Problem with direct linking to a binary file

Problem with direct linking to a binary file

Tuesday 28 September 2004 11:48:47 pm - 2 replies

Author Message

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

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.