The transfer of the $_POST and $_FILES simultaneously in the method?

Hi all.
Finished the form of adding services to the site, I want to be able to upload images to the site, there is a method:

public function admin_add(){
 if ($_POST){
 $result = $this->model->save($_POST);
 if ($result){
 Session::setFlash('the Page was saved.');
 } else {
Session::setFlash('Error.');
}
 // Router::redirect('/admin/services/');
}
 }

By default, it passes $_POST request, but the image I have comes in $_FILES,
how can I pass both requests simultaneously so one could take the content from another both the image and save in database?

Have ideas, but don't know how correct:

1.
public function admin_add(){
 if ($_POST && $_FILES){
 $result = $this->model->save($_POST);
 $result = $this->model->save($_FILES);
 if ($result){
 Session::setFlash('the Page was saved.');
 } else {
Session::setFlash('Error.');
}
 // Router::redirect('/admin/services/');
}
 }


2.
public function admin_add(){
 if ($_POST && $_FILES){

 $result = array_merge ($_POST, $_FILES);
 $result = $this->model->save($result);
 if ($result){
 Session::setFlash('the Page was saved.');
 } else {
Session::setFlash('Error.');
}
 // Router::redirect('/admin/services/');
}
 }
June 14th 19 at 21:05
2 answers
June 14th 19 at 21:07
Solution
A sense to transfer somewhere that is available everywhere?
Well I have and it turns out it works already, just didn't notice, this is the model:

$path = UPLOADS.'services'.DS;
 if (!@copy($_FILES['picture']['tmp_name'], $path . $_FILES['picture']['name'])){
 $picture = $this->db->escape($_FILES['picture']['name']);
}
 // echo $path;
 $picture = $this->db->escape($_FILES['picture']['name']);
- Braeden.Parker52 commented on June 14th 19 at 21:10
June 14th 19 at 21:09
By default, it passes $_POST request, but the image I have comes in $_FILES,
If you have the type of form allows you to transfer files, this is POST.
And arrays $_POST and $_FILES is a Superglobal variables.
They are available everywhere.

Find more questions by tags PHP