I am using Moodle 3.1+. I have used filepicker to upload a file. It is working fine. But filepicker only shows the uploaded file name. I want to show the uploaded image in the filepicker and it seems impossible. Another option is to use filemanager, but it needs extra parameters like contextid which is not there in my case. I am inserting the uploaded image path in a table created by me. So how can I save the file using filemanager into a custom table?
file_save_draft_area_files($data->attachments, $context->id, 'mod_glossary', 'attachment',
$entry->id, array('subdirs' => 0, 'maxbytes' => $maxbytes, 'maxfiles' => 50));