Triggering an Event when a file is uploaded anywhere on the site

Triggering an Event when a file is uploaded anywhere on the site

by Eva E -
Number of replies: 0

Hello!

I am looking to bring up a modal and do some processing any time a user uploads a file anywhere on the site (course, activity, anywhere). The best way I thought of doing it was by adding an event to the file upload and listening for that event.

There is more than one way to add a file, through drag and drop, or through the filepicker, and it seems they uses different mechanisms. Is there some function that eventually gets called regardless of how or where the file was uploaded that I could attach an event listener to?

Using Moodle 3.7.

Look forward to your thoughts, and thanks in advance.




Average of ratings: -