Forums / Setup & design / Download link to image alias file

Download link to image alias file

Author Message

Marco Zinn

Monday 16 November 2009 12:21:21 pm

Hi there...

I'm trying to create a download (!) link to an image file. To be precise, i want a download link to an image ALIAS file.

What I have is a link to the original file using this template code line:

<h2><a href="/content/download/{$node.data_map.image.contentobject_id}/{$node.data_map.image.id}">download</a> </h2>

I think, that URL code is not documented anywhere, but i just found it by tweaking file download URLs.

What i need is a download link to e.g. the "thumbnail" alias of the image attribute of the current node.

By "download link" i mean, that ez should sent HTTP header for DOWNLOADING the image, just like a file download. Currently, i only have a link, which SHOWS the image:

<a href={$node.data_map.image.content[thumbnail].full_path|ezroot}>

Well, let's hope, that this post actually gets posted...

Marco
http://www.hyperroad-design.com

Marco Zinn

Monday 16 November 2009 12:24:39 pm

Sorry about the "code" tags... it seems i cannot edit my own post and i was not aware of the "literal" tags in here.

[Edit]... damned, now it displays my edited post. Caching, i guess... as always...

Marco
http://www.hyperroad-design.com

Steven E. Bailey

Thursday 19 November 2009 2:39:11 am

Can this be done natively? I don't think so...

But, look at kernel/classes/binaryhandlers/ezfilepassthrough/ezfilepassthroughhandler.php and/or the eZFile::download function - that's how it would have to be done.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com