Forums / Setup & design / Problem with direct linking to a binary file

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