Does anybody know how to make a file download like this?

Author Message

Dicky Leung

Monday 22 December 2008 8:49:43 pm

" The presentation file used by ITB in the IT Security Awareness Seminar can be downloaded <b>HERE</b>. "

The user can download file by click the HERE.

And, the web admin may make the link at the online editor.

Thank you.

source pixel

Monday 22 December 2008 9:50:49 pm

hello, maybe this help
Creating a link to download a file with Online Editor in eZ Publish
http://pwet.fr/blog/creating_a_link_to_download_a_file_with_online_editor_in_ez_publish

Dicky Leung

Monday 22 December 2008 10:50:20 pm

Thank you for your help.

I was following the step to do, but still not work.
Is it affect by using ezpublish 4.0.0 & eZ Online Editor MCE 5.0.0beta3?

Noicokuna Niemoge

Friday 23 January 2009 12:14:42 am

I have the same problem...

And what is the file// link for anyway? o_O

Shiki soku ze ku...

André R.

Friday 23 January 2009 1:40:47 am

file//

Intranets, its a link to the file system. (Like c:\ on windows)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Noicokuna Niemoge

Friday 23 January 2009 1:51:24 am

Hi Andre;

Following the steps described in the blog's post produces a link like:

http://www.site.com/index.php?/site/Media/Files/File_name

Of course people can't download it since they don't have access to Media folder. How to get the addres like:

http://www.site.com/index.php?/site/content/download/529/3682/file/File_name.pdf ? o_O

The template used in that example is:

{def $n='' $attribute='' $url=false() $protocols=array('http', 'file', 'ftp', 'mailto', 'https')
}{if $protocols|contains( $href|explode(':')|extract_left(1) )not()
    }{set $n=fetch(content, node, hash(node_path, $href))
    }{if and($n, $n.object.class_identifier|eq('file'))
    }{set $attribute=$n.data_map.file
    }{set $url=concat( '/content/download/', $attribute.contentobject_id, '/', $attribute.id,'/version/', $attribute.version , '/file/', $attribute.content.original_filename|urlencode )
    }{/if}{/if}{if $url|not()}{set $url=$href}{/if}<a href={$url|ezurl}{section show=$id} id="{$id}"{/section}{section show=$title} title="{$title}"{/section}{section show=$target} target="{$target}"{/section}{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>{$content}</a>{undef $n $attribute $url $protocols}

Shiki soku ze ku...

Noicokuna Niemoge

Friday 23 January 2009 3:35:45 am

Please help, this template looks good to me, I don't know what to change to make it display right link...

Shiki soku ze ku...

Noicokuna Niemoge

Saturday 24 January 2009 11:09:53 am

I'm forced to bump the topic because I really have no idea what to change, where's the problem, etc. I'm really sorry, but I need your help...

Shiki soku ze ku...

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