Statistics of uploaded/shared files

Hi,

We are running NextCloud 11.0.1 on Ubuntu 16.04.1.

We want to know if there is a possibility to check how many times a file is downloaded ?

Example: I upload a PDF file and share it with multiple persons.
Then after 2 weeks I want to see how many times a file is downloaded.

Kr,

Joeri

1 Like

I don’t think there is any way to have aggregate reports, for instance how many times a file was downloaded.

However, the activity log can show you when the file was downloaded. To see activity, find the file, click the … menu and select details. The activity log will be under the activities tab on the right.

There’s no app for that but a long term discussion (on the ownCloud issue tracker):

Or use the webserver logfiles if you don’t want to wait.

I just upgraded to NC12. Has the situation changed in any way? I’m currently sharing some files to multiple people and I’d like to know when everyone has downloaded the files so that I can remove them.

I just took a look at the interface and it seems there are the same options as in NC11 regarding the share reporting. Now my best option seems to be watching the activity stream from each file and try to figure when the files have been downloaded enough times.

No way from the interface yet, but querying this is pretty simple. I have something like:

SELECT
*
FROM `oc_activity`
WHERE `subject` LIKE 'public_shared_file_downloaded'
  AND `affecteduser` LIKE 'myUserName'
  -- you could also JOIN ON oc_filecache.fileid = oc_activity.object_id
  AND `subjectparams` LIKE '%A Cool Video I Made.mp4%'
ORDER BY `oc_activity`.`timestamp`  DESC

But if you just want the count, you could easily alter that to this:

SELECT
COUNT(*)
FROM `oc_activity`
WHERE `subject` LIKE 'public_shared_file_downloaded'
  AND `affecteduser` LIKE 'myUserName'
  -- you could also JOIN ON oc_filecache.fileid = oc_activity.object_id
  AND `subjectparams` LIKE '%A Cool Video I Made.mp4%'

Of course there are many other conditions you could look for, but that should give you some ideas.

2 Likes

Does it make sense to add this also to Nextcloud issue tracker?