core_files_upload File not specified

core_files_upload File not specified

by Alex Phillips -
Number of replies: 0
Hi all, 
I am trying to upload files to Moodle 3.1.1 using the core_files_upload function. Whenever I try to upload the file I get this error:
{
     "exception": "moodle_exception",
     "errorcode": "nofile",
     "message": "File not specified"
}

I am using these parameters:
wstoken: TOKEN
wsfunction: core_files_upload
moodlewsrestformat: json
contextid: 1
componet: user
filepath: /
filename: test.txt
filearea: draft 
filecontent: base64("Hello world")
itemid: 0

Any info on what is causing this error would be greatly appreciated.
 



Average of ratings: -