Please let me know the external function if you have achieved downloading the content . I require the same. thanks
Hi
You can add the token to the url
Example
moodle/webservice/pluginfile.php/22/mod_resource/content/1/afile.pdf?forcedownload=1&token=atoken
Regards
Sergio
Hi,
I have same problem. what token should be use for downloading the content.I am getting this result when itrying to download content. What should i do.
{"error":"Sorry, the requested file could not be found","stacktrace":null,"debuginfo":null,"reproductionlink":null}
The first you must use the function "core_course_get_content".
This function will return a lot of fileutl from a course.
Ex: 1 file URL
http://<your moodle>/webservice/pluginfile.php/37/mod_resource/content/1/BTXDPMHDT.pdf?forcedownload=1
and then, You just add a token into URL
http://<your moodle>/webservice/pluginfile.php/37/mod_resource/content/1/BTXDPMHDT.pdf?forcedownload=1&token=6a18222af87608fe4d2ab2ca7ab1f49a