CodeIgniter Forums
Call to undefined function CodeIgniter\Files\finfo_open() - 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: Call to undefined function CodeIgniter\Files\finfo_open() (/thread-73558.html)



Call to undefined function CodeIgniter\Files\finfo_open() - mirel.popescu - 05-08-2019

Hello.

When I try to upload a new image and get mimetype, I get errors about finfo_open.

In controller i have: 
Code:
52             $file = $this->request->getFile('userfile');
53             $typeOfFile = $file->getMimeType();


At line 53 it throws an error - "APPPATH/Controllers/Comunitate.php : 53 — CodeIgniter\Files\File->getMimeType ()". 
In SYSTEMPATH/Files/File.php at line 137 I have: Call to undefined function CodeIgniter\Files\finfo_open().

Please help me.


RE: Call to undefined function CodeIgniter\Files\finfo_open() - kilishan - 05-08-2019

What server are you running under? I thought this was enabled by default on PHP for versions 5.3 and higher. You might need to check your server setup to be sure it's enabled.


RE: Call to undefined function CodeIgniter\Files\finfo_open() - mirel.popescu - 05-08-2019

(05-08-2019, 07:02 AM)kilishan Wrote: What server are you running under? I thought this was enabled by default on PHP for versions 5.3 and higher. You might need to check your server setup to be sure it's enabled.

On Windows xampp local worked perfectly. It seems that my hosting provider didn't activated fileinfo from php.
Now everything is fine. Thank you.


RE: Call to undefined function CodeIgniter\Files\finfo_open() - kilishan - 05-08-2019

Glad to hear it's working!