Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-32336

Modify the web services framework to support file downloads




      Currently the web services framework support 3 data type, "external_multiple_structure", "external_single_structure", and "external_value". In order to create a web service function to download files it is currently necessary to:

      • In the web service function - Create the logic to get the files and place them in the user's file area
      • Have the client call webservice/pluginfile.php to download the file

      In order to simplify this process for web service clients we are proposing to create a new web services data type called external_file.

      The new "external_file" will contain the filename and file itself for webservice's return().

      We then change the webservices handling logic to check when the return type is of external_file and generate a binary file streaming HTTP Response as opposed to generating the regular Response data structure.

      This requires 2 implementations, 1 for REST and 1 for the other protocols (as all AMF/XmlRPC/SOAP used 1 implementation based on Zend). This Tracker issue will address implementation of REST protocol only.

      See also http://moodle.org/mod/forum/discuss.php?d=199866


          Issue Links



              • Votes:
                0 Vote for this issue
                8 Start watching this issue


                • Created: