Upload media
Upload and delete media files.
Upload
You can upload files By following the next steps:
Create a file type field in a form. This example is for a image file, but you can change its properties for whatever you need.
View.pm
$form->field('field_name', {type=>'file', accept=>"image/x-png,image/gif,image/jpeg"});
Controller.pm, Actions.pm
my $image_file_name = $self->upload_file('field_name', 'directory');