eZ Community » Forums » Setup & design » Count download of files

Count download of files

Count download of files

Friday 26 August 2005 4:44:47 pm - 12 replies


I am aware that the ezbinaryfile has attribute that is called <i>download_count</i> for holding the number of times a binary files is downloaded.

But; I have some articles with pictures in it. I want to keep a counter over how many times each of those pictures are downloaded. Is this possible to do?

Friday 26 August 2005 9:37:51 pm

As far as I know, there's no way to do it using a standard eZ installation... You could look for some extension in contributions. I think that there's an extension that can parse the apache log file to count page hits. And since pictures in eZ are stored in folders, maybe this could be the sollution.

Sunday 28 August 2005 1:55:31 pm

Thank you Marko for your answer.

Are there anyone else that may have a solution/done this before?

Sunday 28 August 2005 4:08:56 pm

Hm... Now that i think of this...

There's an extension called "ezstats", made by Konrad Mazurkiewicz and I'm working on it too.

This extension defines a new eZ operator that when called with a node id counts that node. And then you can see how many times a node was accesed.

This is primarily used as page hit's counter, but if the pictures you want to count are actually nodes in eZ, I think that ezstats can be used for your needs.

Check out the extension here:


and contact me if you need help.

Tuesday 30 August 2005 10:37:19 am

Thank you Marko - I will check out that extension.

What I am developing is a library system containing of pictures, documents and other media files. All files are presented with corresponding info about them; i.e. title, date, maker etc. in a thumbnail gallery. When the user clicks on a thumbnail, the system will show a new page where the user can download the media. Here's the point where the download counter will be.

Tuesday 30 August 2005 11:00:53 am

So if I understood you well, you want to count how many times a user opened the download page for an item. If so, that can be done with ezstats.

You'll have to call the ezstats operator that counts nodes in the template used for the download page.

Tuesday 30 August 2005 12:24:15 pm

Thank you again Marko.

That's almost what I'm trying to do, but I want the counter to increase when the file is downloaded, not when only viewed. Is it possible to connect the ezstats extension to that specified action <i>download</i>?

Wednesday 31 August 2005 10:02:44 am

I have now got a counter when downloading media of type FILE (by using download_counter), but what about IMAGES?

Friday 02 September 2005 8:00:21 am


Also; the problem is that I have to count the number of times an IMAGE is downloaded (not viewed) the same way as for the FILE attribute of an object.

I surly could have defined the imagedata as FILE aswell, but then I loose the availibility to scale them using attribute_view_gui and image_class.

Friday 02 September 2005 10:40:25 am

I've been busy theese days so I didn't answer...

If you can override some template for your download action then, yes you CAN count the downloads of the pictures. How do you make your pictures available for download? Please, be detailed.

Friday 02 September 2005 11:13:22 am

Thank you again Marko!

All I have done to make them downloadable is:

{def $attribute=$node.object.data_map.bilde}
<a href={concat( 'content/download/',
'/', $attribute.id, '/file/',
$attribute.content.original_filename|urlencode )|ezurl}>

Modified on Friday 02 September 2005 11:14:27 am by Kjell Inge Sandvik

Saturday 03 September 2005 4:29:18 pm

You should check if you can override some eZ template for:


I'm too busy to check it out, so you should do it. Try browsing the eZ docs, or asking on forum.

Modified on Saturday 03 September 2005 4:32:30 pm by Mavko Žmak - Žmale

Wednesday 07 September 2005 8:15:26 am

Thank you Marko, but I havn't got a clue how to do this. Anybody else?


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from