by Damyon Wiese.
The context id is not required (best to leave it out really)
For private files the itemid is not needed either.
The error you are getting is because the
contextlevel must be set to 'user' and the instanceid must be the id of the user
Here is an alternative way to upload files:
https://docs.moodle.org/dev/Web_services_files_handling
For private files the itemid is not needed either.
The error you are getting is because the
contextlevel must be set to 'user' and the instanceid must be the id of the user
Here is an alternative way to upload files:
https://docs.moodle.org/dev/Web_services_files_handling