CodeIgniter Forums
Get uploaded file data in CI 4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: Get uploaded file data in CI 4 (/thread-74389.html)



Get uploaded file data in CI 4 - webdevron - 09-18-2019

In Codeigniter 3, $this->upload->data(); does it. In documentation of CI 4, I found some functions for getting specific uploaded file data like, getName(), getClientName(), getClientMimeType() etc. But how can I get all the uploaded file data at once like CI 3?

I am using $file->store(); to upload file.

Thanks in advance.


RE: Get uploaded file data in CI 4 - InsiteFX - 09-18-2019

All of the parameters are in the $_FILES[] array.

PHP Code:
$file_name     $_FILES["photo"]["name"]; 
$file_type     $_FILES["photo"]["type"]; 
$file_size     $_FILES["photo"]["size"]; 
$file_tmp_name $_FILES["photo"]["tmp_name"]; 
$file_error    $_FILES["photo"]["error"]; 

Where photo would be the input name.