Cakephp映像-无法确定mimetype

Cakephp映像-无法确定mimetype,cakephp,cakephp-2.0,cakephp-2.3,Cakephp,Cakephp 2.0,Cakephp 2.3,CakePHP2.3 我正在上传一个图像,我有一个错误,我说: Can not determine the mimetype. Error: An Internal Error Has Occurred. 在我的模型上,这是我的$validation的一部分 'file_name' => array( 'uploadError' => array( 'rule' =>'uploadError',

CakePHP2.3

我正在上传一个图像,我有一个错误,我说:

Can not determine the mimetype.

Error: An Internal Error Has Occurred.
在我的模型上,这是我的$validation的一部分

'file_name' => array(
            'uploadError' => array(
                'rule' =>'uploadError',
                'message' => 'Your image upload failed',
                'allowEmpty' => FALSE,
                //'required' => false,
                //'last' => false, // Stop validation after this rule
                //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
            'mimeType' => array(
                'rule' => array('mimeType', array('image/gif', 'image/png', 'image/jpg', 'image/jpeg')),
                'message' => 'Please only upload images (gif, png, jpg).',
                'allowEmpty' => FALSE,
                ),
            'fileSize' => array(
                'rule' => array('fileSize', '<=', '2MB'),
                'message' => 'Your image must be less than 2MB or(2048ko).',
                'allowEmpty' => FALSE,
                ),
            'processCoverUpload' => array(
                'rule' => 'processCoverUpload',
                'message' => 'Unable to process cover image upload.',
                'allowEmpty' => FALSE,
                ),
            'unique' => array(
                'rule' => 'isUnique',
                'message' => 'This file name is already exist in your folder',
                'required' => 'create',
                'allowEmpty' => FALSE,
                ),
        ),
“文件名”=>数组(
“uploadError”=>数组(
'规则'=>'上传错误',
'消息'=>'您的图像上载失败',
“allowEmpty”=>FALSE,
//“必需”=>false,
//'last'=>false,//在此规则之后停止验证
//'on'=>'create',//将验证限制为'create'或'update'操作
),
“mimeType”=>数组(
'规则'=>数组('mimeType',数组('image/gif','image/png','image/jpg','image/jpeg')),
'消息'=>'请仅上载图像(gif、png、jpg)。',
“allowEmpty”=>FALSE,
),
“文件大小”=>数组(

“rule'=>array('fileSize',”我刚刚遇到了完全相同的问题。对于其他一些给我指明了正确方向的注释,下面是我的解决方案: 编辑php.ini(\xampp\php\php.ini在Win7上)搜索
extension=php\u fileinfo.dll
并取消注释


仅供参考:我正在运行xampp 1.7.7[Apache:2.2.21;PHP:5.3.8;MySQL:5.5.16]。希望在较新的xampp版本上默认启用该扩展。

PHP版本?是否将表单设置为type
file
?Thks Tigran。是的,我有
code
…echo$this->表单->输入('file\u name',数组('type'=>'file'));…PHP版本5.3是否已将调试设置为2?是否存在多个内部错误消息?是的,我已将其设置为2。我有一个内部错误(我发布的错误)另一个是堆栈跟踪…你的服务器上有
fileinfo
扩展吗?如果没有,它使用
mime\u content\u type
,这是不推荐的,所以它可能不是很聪明…我想你需要在更改后重新启动xampp,然后问题就解决了