在 moodle 中保存文件管理器的正确顺序和参数

Correct sequence and arguments of filemanager saving in moodle

我正在使用 moodle 的 filemanager 元素上传一个文件
不幸的是,Moodle 的文档组织得非常糟糕且不完整
我不明白我应该如何与该死的 filemanager!
一起工作 目前我是这样做的:

// populating database record object in $record
// ...
$insertid = $DB->insert_record('local_usercertlist', $record);
$draftitemid = file_get_submitted_draft_itemid('pic');
file_save_draft_area_files($draftitemid, $PAGE->context->id, 'local_usercertlist', "type1_{$fromform->uid}", $insertid, array('subdirs' => false, 'maxfiles' => 1));

但是现在不知道上传的文件应该怎么取回!
Moodle 的文档说使用 moodle_url::make_pluginfile_url() 方法,但它需要 pathfilename 我在哪里可以找到它们?!

谁能告诉我在 moodle 中上传和检索文件的正确顺序是什么?!

在线有一个最小的文件管理器示例:https://github.com/AndyNormore/filemanager