I am using the mime_content_type()
function for file upload, it works fine on localhost however I\'m encountering the following error on my live server:
If you are on shared hosting, chances are that the fileinfo PHP extension is either not enabled or installed.
In the case where it's not enabled, navigate to the Software section of CPanel (consult documentation of your control panel if you're not using CPanel) and click Select PHP Version (or something related to that) and enable the extension by checking its box and saving your action.
If it's not installed, the extension won't be part of the PHP extensions at cPanel > Software > Select PHP Version > Extensions
, edit your php.ini
file and uncomment extension=php_fileinfo.dll
if you're on Windows. Consult your hosting provider's docs if any of these don't work.