0
//checks size of uploaded image on server side
if( $_FILES['userfile']['size'] < $maxsize) {

    //checks whether uploaded file is of image type
    //if(strpos(mime_content_type($_FILES['userfile']['tmp_name']),"image")===0) {
    $finfo=finfo_open(FILEINFO_MIME_TYPE);
    if(strpos(finfo_file($finfo, $_FILES['userfile']['tmp_name']),"image")===0) {

        // prepare the image for insertion
        $imgData =addslashes (file_get_contents($_FILES['userfile']['tmp_name']));

        // put the image in the db...
        // database connection
        mysql_connect($host, $user, $pass) OR DIE (mysql_error());

        // select the db
        mysql_select_db ($db) OR DIE ("Unable to select db".mysql_error());

I have already tried changing In php.ini search php_fileinfo.dll to find this:

;extension=php_fileinfo.dll

Delete ; from front, save the file and close. Restart Apache server.But still I am getting the fatal error in line $finfo = finfo_open(FILEINFO_MIME_TYPE); And my php version is 5.6.8 as shown.

aynber
  • 22,380
  • 8
  • 50
  • 63

1 Answers1

0

Hmmm you should send an second parameter to finfo_open function who send the magic file. Please read http://php.net/manual/es/function.finfo-open.php

Frank Leal
  • 212
  • 4
  • 18