Implementing custom hooks / intercept download requests for logging


#1

Hello fellow OwnCloud community!

I wonder if there is a way to implement custom hooks? I found nothing about it on the documentation pages.
My goal is to intercept download requests for logging purposes.

Best regards,
Constantin


#2

Firstly, I'm not sure for my answer, it might be a ridiculous idea. If your purpose only log the downloaded file, maybe you can register a storage wrapper, and wrap fopen function. If it is in read mode you can log it in there. To add custom hook, you should add something in owncloud core, afaik it is not possible with only an app.

https://doc.owncloud.org/server/10.0/developer_manual/app/advanced/storage-backend.html#storage-wrappers


#3

That sounds interesting. I quickly looked into the activities app and they seem to be doing the same thing there. So I think I'm gonna try that.

Thank you very much for the hint!


#4

You are welcome, wish to see your app in marketplace.