Forums / Developer / How to fetch filename

How to fetch filename

Author Message

John Smith

Thursday 08 June 2006 4:22:45 am

Hi there,

Hope someone can help me please.

In the design\news\override\templates\datatype\ezbinaryfile.tpl

{default icon_size='normal' icon_title=$attribute.content.mime_type icon='no'}
{section show=$attribute.has_content}
{section show=$attribute.content}
{switch match=$icon}
    {case match='no'}
        <a href={concat("content/download/",$attribute.contentobject_id,"/",$attribute.id,"/file/",$attribute.content.original_filename)|ezurl}>{$attribute.content.original_filename|wash(xhtml)}</a> {$attribute.content.filesize|si(byte)}
    {/case}
    {case}
        <a href={concat("content/download/",$attribute.contentobject_id,"/",$attribute.id,"/file/",$attribute.content.original_filename)|ezurl}>{$attribute.content.mime_type|mimetype_icon( $icon_size, $icon_title )} {$attribute.content.original_filename|wash(xhtml)}</a> {$attribute.content.filesize|si(byte)}
    {/case}
{/switch}
{section-else}
	<div class="message-error"><h2>{"The file could not be found."|i18n("design/base")}</h2></div>
{/section}
{/section}
{/default}

Here I want to fetch the name of the file given to the file while uploading. I Tried $attribute.content.name, $attribute.name but nothing working at all.

Please help.

Marcin Drozd

Thursday 08 June 2006 5:30:22 am

Hi
I am not sure what U want but try with:
{$attribute.content.filename}
{$attribute.content.original_filename}
{$attribute.object.name}
and U should listing all attributes and values:
{$attribute.content|attribute(show,1)}

http://ez-publish.pl