2

I am trying to use the CSV Me plugin in order to let our client upload a csv file to the database. When i try to upload a file as a test i get the following error message:

Fatal error: Call to undefined function finfo_open() in /home/diamondh/public_html/wp-content/plugins/csv-me/csv_me_index.php on line 110

I took a look at the file in question and found line 110 looking like:

                $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension

As far as i know finfo_open() is a built in part of php so why would it be undefined?

BONUS: Anyone know any better solutions for getting a csv into the wordpress database?

Andrew Font
  • 1,245
  • 3
  • 19
  • 38

1 Answers1

1

finfo_open is only available for php >= 5.3.0 http://www.php.net/manual/en/function.finfo-open.php

You may want to double check your server is up to date with php_info()

RyanS
  • 3,964
  • 3
  • 23
  • 37
  • Ah this may be the issue! Let me check the server. – Andrew Font Jan 22 '14 at 21:09
  • 1
    BONUS: Since csv is a pretty easy to read file format you could use `file_get_contents` and just parse it yourself – RyanS Jan 22 '14 at 21:10
  • our server is 5.3.27...so its weird that i would be getting that error... also to your second comment i will probably use that and just right my own solution for the client rather then using this plugin. – Andrew Font Jan 22 '14 at 21:14
  • It can be conditionally compiled in or added as a module. What platform are you running on? – madebydavid Jan 22 '14 at 21:47
  • It might be disabled: http://stackoverflow.com/questions/3579072/php-fileinfo-is-undefined-function – RyanS Jan 22 '14 at 21:52
  • Worth adding, finfo is not enabled by default on Windows, you have to remove the semi colon from `;extension=php_fileinfo.dll` in your php.ini and then restart your web server for the changes to take affect – zanderwar Oct 28 '15 at 04:15