General developer forum

Problem with function core_files_upload

 
Picture of Patrick Liersch
Re: Problem with function core_files_upload
 

And everyone has tested this example and works?

I tried this and got a error "nofile" - please tell me, where is my fail?


https://<HOST>/<MOODLE>/webservice/rest/server.php?moodlewsrestformat=json&wstoken=<TOKEN FROM OUR WS USER>&wsfunction=core_files_upload&contextlevel=user&instanceid=<USER ID>&component=user&filearea=draft&itemid=0&filepath=/&filename=test&filecontent=hello
 
Average of ratings: -
Picture of Aniket Sankpal
Re: Problem with function core_files_upload
 

Don't pass the parameter itemid and then try

 
Average of ratings: -
Picture of Patrick Liersch
Re: Problem with function core_files_upload
 

The Parameter itemid is required and must be a int value

 
Average of ratings: -
Picture of Aniket Sankpal
Re: Problem with function core_files_upload
 

Can you tell me how you are calling the service?

 Are you using POST method?

 
Average of ratings: -