Email notification after file download on owncloud 10.0.10.4

Hello

I 'm using ownloud 10.0.10.4.

First I would like to thank all of this great application !
I’m really happy of this software, and have been using for a couple of years now.
Thank you very much for your work !

I wish to add an email notification after a file has been downloaded.
Especially when I create a public share link.

By searching in owncloud install dir for php script managing the file download and I foud this file : apps/files/download.php .
I modified this file to add a mail function at the end:
mail("my@mail.org", “File downloaded $filename !”, “The file $filename has just been downloaded.”);

The thing is that this script doesn’t seem to be even called when a user download a file because I tried renaming it as download.php.test, and I am still able to download a file through the we interface on the public share url.

Anyone know which file I should look to add my email notification ?

Thank you

Modifying the code is not recommended for maintainability. You can write a basic filesystem app for your purpose. Check this similar discussion: Listen to \OC\Filesystem's read signal via Util::connectHook

1 Like