I get the finished data from a form via POST in one method and want to pass the image to another method for file upload. How should I pass $ _FILES ['my_image'] from one method to another?
$_FILES['my_image'] is not the image itself, it's an associative array containing information about the uploaded file.
It looks something like this:
[name] => image.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php3zX7t5
[error] => 0
[size] => 25974
08-30-2019, 05:01 AM (This post was last modified: 08-30-2019, 05:03 AM by Henqsan.)
(08-29-2019, 08:33 PM)adamoli Wrote: $_FILES['my_image'] is not the image itself, it's an associative array containing information about the uploaded file.
It looks something like this:
[name] => image.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php3zX7t5
[error] => 0
[size] => 25974
Yes, it is a array. But I'm assigning this array to a variable and sending it to another method of the same class. Then I pass this variable to the CodeIgniter upload class $this->upload->do_upload($my_image['tmp_name']), but returns an error saying no images were uploaded!