我正在按照本教程(http://milesj.me/code/cakephp/uploader)使用上传程序将图像上传到亚马逊s3并提供
//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
出了什么问题,我该怎么办?有人可以帮忙吗?
答案 0 :(得分:0)
我从上面的评论中得到了答案,您只需要在php.ini文件中取消extension=php_fileinfo.dll
取消注释。