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.

eZ debug

Timing: Jan 18 2025 16:24:21
Script start
Timing: Jan 18 2025 16:24:21
Module start 'layout'
Timing: Jan 18 2025 16:24:21
Module start 'content'
Timing: Jan 18 2025 16:24:22
Module end 'content'
Timing: Jan 18 2025 16:24:22
Script end

Main resources:

Total runtime0.9165 sec
Peak memory usage4,096.0000 KB
Database Queries76

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.1328152.6406
Module start 'layout' 0.00590.0026 740.773439.4766
Module start 'content' 0.00850.9065 780.2500657.9922
Module end 'content' 0.91500.0015 1,438.242216.1094
Script end 0.9164  1,454.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3674160.0002
Check MTime0.00130.1426160.0001
Mysql Total
Database connection0.00070.074810.0007
Mysqli_queries0.860393.8673760.0113
Looping result0.00080.0908740.0000
Template Total0.885696.620.4428
Template load0.00190.208120.0010
Template processing0.883796.423920.4418
Template load and register function0.00030.027910.0003
states
state_id_array0.00080.090210.0008
state_identifier_array0.00170.187620.0009
Override
Cache load0.00160.1726340.0000
Sytem overhead
Fetch class attribute can translate value0.00070.081540.0002
Fetch class attribute name0.00200.221990.0002
XML
Image XML parsing0.00100.109440.0003
class_abstraction
Instantiating content class attribute0.00000.001790.0000
General
dbfile0.00080.0833170.0000
String conversion0.00000.000740.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs