对于Cakephp 2.6,我有以下警告:
无法确定mimetype。 错误:发生了内部错误。
下面是我的模型:
'mimeType' => array(
'rule' => array('mimeType', array('image/gif', 'image/png', 'image/jpg', 'image/jpeg')),
'message' => 'Please only upload images (gif, png, jpg).',
'allowEmpty' => FALSE,
),在php.ini (\xampp\php\php.ini)中,我没有注释
extension=php_fileinfo.dll 但我仍然有同样的错误信息。
即使我的调试设置为2,错误消息中也没有行号。唯一显示的错误消息是:Can not determine the mimetype.Error: An Internal Error Has Occurred。对于堆栈跟踪,“验证::mimeType(数组,数组)”的值为
array(
'name' => '2009_Infini-jaune-2.jpg',
'type' => 'image/jpeg',
'tmp_name' => 'C:\xampp\tmp\phpEC6C.tmp',
'error' => (int) 0,
'size' => (int) 186994)数组( (int) 0 => 'image/png',(int) 1 =>‘=>/jpeg’)
发布于 2015-02-16 23:06:41
启用或禁用扩展时,请确保重新启动web服务器(如果您将PHP作为FastCGI实例运行)。
发布于 2016-06-22 09:27:06
将文本;extension=php_fileinfo.dll转换为extension=php_fileinfo.dll on php.ini,它对我有用。希望它能帮到你们。我在用xampp。
别忘了在那之后重新启动web服务器。
https://stackoverflow.com/questions/28550960
复制相似问题