Adding code to processing uploaded files

Adding code to processing uploaded files

by Emri Lead -
Number of replies: 3

hello

I would like to add another validation for every file uploaded in addition to what moodle has.
in certain cases this validation should stop and throw an exception' giving the user an error.

seems the best place to do so is in "proccess_upload" function in /repository/upload/lib.php
problem is, it's a core file and I don't want to modify core files.

I would however like to use  use my theme renders for it but I can't see a way to do so.

How else can I do what I want to do ? could "events" come in handy in this case ?
if so which event should I use ?


my moodle version is 2.7

Average of ratings: -
In reply to Emri Lead

Re: Adding code to processing uploaded files

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Events *would* be the answer, but there doesn't seem to be one for uploading a file sad

Average of ratings: Useful (1)
In reply to Howard Miller

Re: Adding code to processing uploaded files

by Emri Lead -

is it possible to create such an event without modifying the core code ?