Find the number of files downloaded from Event Handlers?

Hi,

 

In the user guide about Event Handlers, Event Handlers (m-files.com) there is mentioned that you can for example prevent downloading of many files.

My question is how can I access this information from the Event Handler? There are BeforeFileDownload and AfterFileDownload, but not any documentation that I kind find of the number of files downloaded.

Where I can access how many files are being downloaded in one session or can you only access this information file by file?

I would like to create a notification when a user downloads a number of files over the limit and send a notification about this to the admins.

Parents
  • I don't think there's an explicit count here; I think the example given indicates that you could log who is downloading a file here and, if the count in a given time period is too high, throw an exception to stop more items being downloaded.  I've not done this before but, in this scenario, I assume you'd log to some third-party database, perhaps.

    I would urge some caution though.  Things like offline files can download lots of content quickly.  That's a potentially viable thing for people to do, and you wouldn't want that to trigger your warnings.

Reply
  • I don't think there's an explicit count here; I think the example given indicates that you could log who is downloading a file here and, if the count in a given time period is too high, throw an exception to stop more items being downloaded.  I've not done this before but, in this scenario, I assume you'd log to some third-party database, perhaps.

    I would urge some caution though.  Things like offline files can download lots of content quickly.  That's a potentially viable thing for people to do, and you wouldn't want that to trigger your warnings.

Children