2014-01-30 76 views
0

我使用上传上传图片到Amazon S3并按照本教程(http://milesj.me/code/cakephp/uploader)它给上传错误

//view 
<?php echo $this->Form->create('OtherModel',array('type' => 'file')); 
echo $this->Form->input('Upload.0.upload',array('type' => 'file', 'class'=>'form-control')); 
echo $this->Form->input('Upload.1.upload',array('type' => 'file', 'class'=>'form-control')); 
echo $this->Form->end(__('Submit'),array('class'=>'btn btn-success')); ?> 

在控制器我用$this->OtherModel->saveAssociated($this->request->data)

//model Upload 
    var $actsAs = array(
      'Uploader.Attachment' => array('upload' => array(
                   'overwrite' => false,                
                   'transport' => array(
                   'class' => AttachmentBehavior::S3, 
                   'accessKey' => '...', 
                   'secretKey' => '...', 
                   'bucket' => '...', 
                   'region' => ..., 
                   'folder' => '...', 
                   'returnUrl' => true 
                        )))); 

它给我的错误我提交

Error: Call to undefined function Transit\finfo_open() 
File: C:\wamp\www\car_dealers\app\Vendor\mjohnson\transit\src\Transit\File.php 
Line: 338 
Notice: If you want to customize this error message, create app\View\Errors\fatal_error.ctp 

什么是错,我该怎么办?任何人都可以帮忙吗?

+1

检查您的finfo http://www.php.net/manual/en/fileinfo.setup.php – timstermatic

+1

谢谢,它的工作原理! –

回答

0

我从aboe评论得到了一个答案,你只需要在你的php.ini文件中取消extension=php_fileinfo.dll取消注释。

+0

我有同样的问题,但你的解决方案还不够,你可以给我一个问题一下http://stackoverflow.com/questions/22233228/cakephp-upload-image-can-not-determine-the-mimetype – Enzero