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
(Created page with "=Proposal for sending file from the client to Moodle = 1- The client call webservice/pluginfile.php The client send the FILES by HTTP calling webservice/upload.php with the web ...")
 
Line 1: Line 1:
=Proposal for sending file from the client to Moodle =
=Proposal for sending file from the client to Moodle =
1- The client call webservice/pluginfile.php
1- The client calls webservice/pluginfile.php


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


The upload script store the file 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.


2- The  client calls the web service function. It send as much draft area id that 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.  


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


The text send by the client should contain the @@pluginfile....@@ string to reference the files.
Texts sent by the client should contain @@pluginfile....@@ strings to reference the files.

Revision as of 03:57, 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.

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.