Welcome Guest, Not a member yet? Register   Sign In
Ci4 Pass Uploaded Image from Controller to Model
#1

Hi,
Is it possible to pass an uploaded image file to a model for processing, something like:

PHP Code:
$file $this->request->getFile('image');
$id $this->request->getPost('id');
$image_use $this->request->getPost('image_use');
            
$process_image = new \App\Models\Admin\Image_manager;
$this->$data['result']=$process_image->save_image($file$id$image_use); 
Thanks in advance
Reply
#2

Yes, it's possible. The model are just a PHP-class like everything else. But you are trying to store it in your database? You should store it as a BLOB, but i don't recommend it. Keep it as a file.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB