Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:Web services files handling: Difference between revisions

From MoodleDocs
Line 6: Line 6:
The upload script stores the files in a draft area. It send back the draft aera id to the client in JSON format.
The upload script stores the files in a draft area. It send back the draft aera id to the client in JSON format.


The files that can be sent by a user have the same restriction (number of files, max size...) as if the user were using the web interface.
The files, that a user can send, have the same restriction (number of files, max size...) as if the user were using the web interface.


2- The  client calls the web service function. It send as many draft area ids that are requested by the web service function.  
2- The  client calls the web service function. It send as many draft area ids that are requested by the web service function.  

Revision as of 04:13, 3 January 2013

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. It send back the draft aera id to the client in JSON format.

The files, that a user can send, have the same restriction (number of files, max size...) as if the user were using the web interface.

2- The client calls the web service function. It send as many draft area ids that are requested by the web service function.

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

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