// disable moodle specific debug messages
disable_debugging();
- $relativepath = get_file_argument('file.php');
+ $relativepath = get_file_argument('draftfile.php');
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
// relative path must start with '/'
}
$contextid = (int)array_shift($args);
- $filearea = array_shift($args);
+ $itemid = (int)array_shift($args);
$context = get_context_instance_by_id($contextid);
if ($context->contextlevel != CONTEXT_USER) {
print_error('invaliduserid');
}
- switch ($filearea) {
- case 'user_draft' : $itemid = (int)array_shift($args); break;
- default: send_file_not_found();
- }
-
$relativepath = '/'.implode('/', $args);
-
$fs = get_file_storage();
- $fullpath = $context->id.$filearea.$itemid.$relativepath;
+ $fullpath = $context->id.'user_draft'.$itemid.$relativepath;
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->get_filename() == '.') {
send_file_not_found();
// disable moodle specific debug messages
disable_debugging();
- $relativepath = get_file_argument('file.php');
+ $relativepath = get_file_argument('pluginfile.php');
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
// relative path must start with '/'
// disable moodle specific debug messages
disable_debugging();
- $relativepath = get_file_argument('file.php');
+ $relativepath = get_file_argument('userfile.php');
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
// relative path must start with '/'