Fatal error: Class 'finfo' not found in C:\xampp\htdocs\portfolio\actions\addProject_action.php on line 49 -


i'm trying fileupload on website. , checked in php manual , found checking filetype:

// not trust $_files['upfile']['mime'] value !! // check mime type yourself. $finfo = new finfo(fileinfo_mime_type); // line 49 if (false === $ext = array_search(     $finfo->file($_files['topimage']['tmp_name']),     array(         'jpg' => 'image/jpeg',         'png' => 'image/png',         'gif' => 'image/gif',     ),     true )) {     throw new runtimeexception('invalid file format.'); } 

but code php error says: fatal error: class 'finfo' not found in c:\xampp\htdocs\portfolio\actions\addproject_action.php on line 49

anyone know why , how fix this? (apparently have wrong php version 5.2.0, more know if there similar way in erlier php versions?)

i have code inside this:

if(empty($_files['topimage'])){     $errors['topimage'] = "you have choose top image."; }else{     // code inside here } 

i think finfo class available in php >= 5.3.0. maybe php lower 5.3.0.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -