CodeIgniter Forums

Full Version: Call to undefined function CodeIgniter\Files\finfo_open()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
(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.
Glad to hear it's working!