2014-01-30 74 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