How do I extract the actual filename of $mod->url inside /course/renderer.php ? On the verge of a paradigm shift...or at least I think so

Re: How do I extract the actual filename of $mod->url inside /course/renderer.php ? On the verge of a paradigm shift...or at least I think so

by Frankie Kam -
Number of replies: 0
Picture of Plugin developers

I'll need to call $fs = get_file_storage()

Then I'll have to call $files = $fs->get_area_files($modulecontextid, 'mod_resource', 'the name of the filearea that mod_resource uses internally')

Then I need to look through the file(s) returned and get the filename.

Well, I've got the gist of it from the maker of "drag and drop file upload" in Moodle, but if anyone has the working code to do this, please let me know. Thanks.