Programmatically uploading files

Re: Programmatically uploading files

by Davo Smith -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

itemid = id to uniquely identify the file area, the meaning depends on the plugin that implements the file area, so you'd have to look at the code to find out what it means in this particular case (for draft file areas it is random)

ctx_id - almost certainly the id of the context that the file is stored in (Moodle uses a hierarchy of contexts - starting at the system level, but also including course categories, courses, activities, blocks and user context).

client_id - not sure, off the top of my head

assignment_id - the id of the mdl_assign record associated with the upload - not the id from the URL, as that is the id of the mdl_course_modules record (which abstracts away from the individual activity types, and contains an 'instanceid' which points to the record in the relevant activity's table).