MDL-60302 webservice: Allow CORS requests in webservice/upload.php
This will allow to upload files via Web Services using AJAX from different domains, browser plugins, web apps, etc…
This commit is contained in:
@@ -43,6 +43,10 @@ define('NO_MOODLE_COOKIES', true);
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once($CFG->dirroot . '/webservice/lib.php');
|
||||
|
||||
// Allow CORS requests.
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
$filepath = optional_param('filepath', '/', PARAM_PATH);
|
||||
$itemid = optional_param('itemid', 0, PARAM_INT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user