All files in Midrub all uploaded through the core's class Upload. The class Upload is located in the folder application/base/classes/media and i recommend to use it to upload the files because it supports hooks and will be always improved for the best performance.
Add the namespace in your file's header:
// Define the namespaces to use
use MidrubBase\Classes\Media as MidrubBaseClassesMedia;
Then use this:
// Prepare the file
$file_args = array(
'cover' => 'url for cover',
'category' => 'optionally contains the media category'
'allowed_extensions' => 'array with supported extensions'
allowed_extensions supports an array with this format array('image/png', 'image/jpeg', 'image/gif', 'video/mp4', 'video/webm', 'video/avi').
This is important for two reasons:
- type/format allows to verify if the uploaded file has approved format.
- type is saved in the database.