LMSouq
moodle-core Open

Filemanager save file into custom table

AK
Akhilesh
1 month ago
3 views
Problem Description
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));

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base