Talk:Web services files handling

Jump to: navigation, search

Proposal for sending file from the client to Moodle

1- The client calls webservice/pluginfile.php

The client sends the FILES by HTTP calling webservice/upload.php with the web service token.

The upload script stores the files in a draft area. If the itemid in the request is missing or is 0, a new draft area will be created. It send back the draft area id to the client in JSON format.

2- The client calls the web service function. It sends as many draft area ids as it is requested by the web service function.

Texts sent by the client should contain @@pluginfile....@@ strings to reference the files.

Note: in Moodle web service structure, we need to add a new param for draft id when dealing with textarea/description/introeditor.

Note: core_user_add_user_private_files will copy files from a draft area to a users private files area and (applying any file restrictions).