Upload a file as a resource in a section using core_files_upload

Upload a file as a resource in a section using core_files_upload

by Sebastian Rettig -
Number of replies: 0

Hi,

I want to upload a file into moodle courses using the Web Service API. They should be added as resources in sections of the course. I assume the function "core_files_upload" does this, but I can't find any documentation on the parameters.


What are possible values for component? What do the values for contextlevel (block, course, coursecat, system, user, module) mean? Should I set the filepath as well? How do I tell moodle that the file should be added as a resource into a section? Is this even possible? I haven't found any way of creating a resource activity (or "module" as it seems to be called) through a webservice, so I fear that what I want to do can't be done at all.

Thanks
Sebastian

Average of ratings: -