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());
我已經嘗試改變在php.ini中搜索php_fileinfo.dll 找到這個:致命錯誤:調用未定義功能finfo_open()
;extension=php_fileinfo.dll
刪除;從前面保存文件並關閉。重新啓動Apache服務器。但仍然收到致命錯誤行$ finfo = finfo_open(FILEINFO_MIME_TYPE);如圖所示,我的php版本是5.6.8。