Search moodle.org's
Developer Documentation


External files API

Copyright: 2010 Dongsheng Cai
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 471 lines (19 kb)
Included or required:0 times
Referenced: 4 times
Includes or requires: 0 files

Defines 2 classes

core_files_external:: (6 methods):
  get_files_parameters()
  get_files()
  get_files_returns()
  upload_parameters()
  upload()
  upload_returns()

moodle_file_external:: (6 methods):
  get_files_parameters()
  get_files()
  get_files_returns()
  upload_parameters()
  upload()
  upload_returns()


Class: core_files_external  - X-Ref

Files external functions

get_files_parameters()   X-Ref
Returns description of get_files parameters

return: external_function_parameters

get_files($contextid, $component, $filearea, $itemid, $filepath, $filename, $modified = null,$contextlevel = null, $instanceid = null)   X-Ref
Return moodle files listing

param: int $contextid context id
param: int $component component
param: int $filearea file area
param: int $itemid item id
param: string $filepath file path
param: string $filename file name
param: int $modified timestamp to return files changed after this time.
param: string $contextlevel The context level for the file location.
param: int $instanceid The instance id for where the file is located.
return: array

get_files_returns()   X-Ref
Returns description of get_files returns

return: external_single_structure

upload_parameters()   X-Ref
Returns description of upload parameters

return: external_function_parameters

upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent, $contextlevel, $instanceid)   X-Ref
Uploading a file to moodle

param: int    $contextid    context id
param: string $component    component
param: string $filearea     file area
param: int    $itemid       item id
param: string $filepath     file path
param: string $filename     file name
param: string $filecontent  file content
param: string $contextlevel Context level (block, course, coursecat, system, user or module)
param: int    $instanceid   Instance id of the item associated with the context level
return: array

upload_returns()   X-Ref
Returns description of upload returns

return: external_single_structure

Class: moodle_file_external  - X-Ref

Deprecated files external functions

get_files_parameters()   X-Ref
Returns description of get_files parameters

return: external_function_parameters

get_files($contextid, $component, $filearea, $itemid, $filepath, $filename)   X-Ref
Return moodle files listing

param: int $contextid
param: int $component
param: int $filearea
param: int $itemid
param: string $filepath
param: string $filename
return: array

get_files_returns()   X-Ref
Returns description of get_files returns

return: external_single_structure

upload_parameters()   X-Ref
Returns description of upload parameters

return: external_function_parameters

upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent)   X-Ref
Uploading a file to moodle

param: int $contextid
param: string $component
param: string $filearea
param: int $itemid
param: string $filepath
param: string $filename
param: string $filecontent
return: array

upload_returns()   X-Ref
Returns description of upload returns

return: external_single_structure

Search This Site: