Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_files_external Class Reference

Files external functions. More...

Inheritance diagram for core_files_external:

Static Public Member Functions

static get_files ($contextid, $component, $filearea, $itemid, $filepath, $filename, $modified=null, $contextlevel=null, $instanceid=null)
 Return moodle files listing.
 
static get_files_parameters ()
 Returns description of get_files parameters.
 
static get_files_returns ()
 Returns description of get_files returns.
 
static upload ( $contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent, $contextlevel, $instanceid)
 Uploading a file to moodle.
 
static upload_parameters ()
 Returns description of upload parameters.
 
static upload_returns ()
 Returns description of upload returns.
 

Detailed Description

Files external functions.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 2.2

Member Function Documentation

◆ get_files()

static core_files_external::get_files ( $contextid,
$component,
$filearea,
$itemid,
$filepath,
$filename,
$modified = null,
$contextlevel = null,
$instanceid = null )
static

Return moodle files listing.

Parameters
int$contextidcontext id
int$componentcomponent
int$fileareafile area
int$itemiditem id
string$filepathfile path
string$filenamefile name
int$modifiedtimestamp to return files changed after this time.
string$contextlevelThe context level for the file location.
int$instanceidThe instance id for where the file is located.
Return values
array
Since
Moodle 2.9 Returns additional fields (timecreated, filesize, author, license)
Moodle 2.2

◆ get_files_parameters()

static core_files_external::get_files_parameters ( )
static

Returns description of get_files parameters.

Return values
external_function_parameters
Since
Moodle 2.2

◆ get_files_returns()

static core_files_external::get_files_returns ( )
static

Returns description of get_files returns.

Return values
external_single_structure
Since
Moodle 2.9 Returns additional fields for files (timecreated, filesize, author, license)
Moodle 2.2

◆ upload()

static core_files_external::upload ( $contextid,
$component,
$filearea,
$itemid,
$filepath,
$filename,
$filecontent,
$contextlevel,
$instanceid )
static

Uploading a file to moodle.

Parameters
int$contextidcontext id
string$componentcomponent
string$fileareafile area
int$itemiditem id
string$filepathfile path
string$filenamefile name
string$filecontentfile content
string$contextlevelContext level (block, course, coursecat, system, user or module)
int$instanceidInstance id of the item associated with the context level
Return values
array
Since
Moodle 2.2

◆ upload_parameters()

static core_files_external::upload_parameters ( )
static

Returns description of upload parameters.

Return values
external_function_parameters
Since
Moodle 2.2

◆ upload_returns()

static core_files_external::upload_returns ( )
static

Returns description of upload returns.

Return values
external_single_structure
Since
Moodle 2.2

The documentation for this class was generated from the following file: