Active
Project:
Filefield download tracker
Version:
6.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Jul 2010 at 13:38 UTC
Updated:
28 Mar 2011 at 09:26 UTC
Can you help me create a method for notifying a particular user of when a file is downloaded. I have a site that has a content type of "tender" which has a CCK field that has the tender in pdf format. I need an email sent to a user or role when the file is downloaded.
Thanks
Comments
Comment #1
svendecabooterYou can achieve this by using the hook_filefield_tracker. Some example code to get you started (which should go in a separate module):
Comment #2
svendecabooterMarking as fixed. Let me know if you have any problems
Comment #3
ginga8 commentedDo you think that you will be implementing something like this in the next release. I am very novice when it comes to php and drupal and I am not sure I can implement this?
Comment #4
svendecabooterComment #5
yetihunter1000 commentedThis looks like the solution I'm after, where should I place the above code?
Comment #6
svendecabooterYou should put it in your own custom module.
Basically you need to create a new folder in sites/all/modules, add a mymodule.info and mymodule.module file, and paste the code above in mymodule.module.
You can replace all instances of "mymodule" with a better name for your module.
For more instructions on the .info file and creating your module: http://drupal.org/node/206753
Comment #7
svendecabooterActually i might look into integrating with the Actions / Triggers module, so you can use the Drupal UI to create this email notification.
Will check later if this is possible...
Comment #8
yetihunter1000 commentedThank you for your replies, that would be great if that was an option to use as my client has asked to be emailed on the download and at the moment I cannot get this to work, even with the custom module, so am looking for ways around this.