Forums / Setup & design / Track file downloads?

Track file downloads?

Author Message

Daniel Guerrier

Wednesday 25 January 2006 9:48:52 am

I would like to create a feature where one user can see what files were downloaded by another user, but those files are part of a content object. The default download functionality only tracks how many times a file download was done. Can someone provide some insite as to how to track what was downloaded by a user but relative to the content object that is holding the file. Or how to create my own download functionality that records what content object the file is being accesed from and from what user session.

I will galdly except pointers to documentation that gives an idea on how to do this.
I looked far and wide and did not find any.

Thanks!!

Daniel Guerrier

Thursday 26 January 2006 7:03:00 am

Hoping that someone has looked at this.
Can someone chime in with a suggestion?

Daniel Guerrier

Thursday 26 January 2006 12:49:47 pm

Just keeping this on top in hopes that someone takes the time to look at it.

Ɓukasz Serwatka

Friday 27 January 2006 12:39:56 am

Hi Daniel,

You will need to track user id who download the file, and contentobject_attribute_id of this file (use new table). You can make your own download handler and a template operator which displays / fetches this information. Look on examples in eZ publish kernel/classes/binaryhandlers. This can be very nice contribution ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Daniel Guerrier

Friday 27 January 2006 12:25:04 pm

How would I associate the file with the content object that it is contained in?

Thanks.

Leif Arne Storset

Saturday 28 January 2006 1:43:57 pm

I have the exact same need to log file downloads by users. I would love to develop an extension, but am unable to find any information on how to create a custom binary file handler. Any pointers, Lukasz?

My idea is to extend the class eZFilePasstroughHandler [sic] and simply override handleDownload(...), calling the superclass's function before or after logging the download. But how to register this new handler class?

Leif Arne Storset

eZ debug

Timing: Jan 31 2025 01:14:24
Script start
Timing: Jan 31 2025 01:14:24
Module start 'content'
Timing: Jan 31 2025 01:14:24
Module end 'content'
Timing: Jan 31 2025 01:14:24
Script end

Main resources:

Total runtime0.0355 sec
Peak memory usage8,192.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 587.9219370.3047
Module start 'content' 0.00890.0182 958.22661,005.5000
Module end 'content' 0.02710.0082 1,963.726674.7031
Script end 0.0354  2,038.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00298.1290120.0002
Check MTime0.00113.1996120.0001
Mysql Total
Database connection0.00071.996010.0007
Mysqli_queries0.00349.609540.0009
Looping result0.00000.087420.0000
Template Total0.007721.810.0077
Template load0.00102.923410.0010
Template processing0.006718.837910.0067
Override
Cache load0.00061.826610.0006
General
dbfile0.005615.7654100.0006
String conversion0.00000.024930.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs