【问题标题】:CakePHP - Miles Uploader Plugin - Isset ErrorCakePHP - Miles Uploader 插件 - Isset 错误
【发布时间】:2011-07-13 14:06:13
【问题描述】:

我已经尝试了几个 CakePHP 文件上传器,但都没有成功设置并使其工作。我已经和Miles Uploader Plugin 安定下来,我正在尽我所能让它发挥作用。安装说明非常好,我已经完全按照它们进行操作,但仍然无法正常工作。

当我发布文章时,我收到以下错误:

 Warning (2): Illegal offset type in isset or empty [APP/plugins/uploader/controllers/components/uploader.php, line 1104]
    }
    if (isset($this->_data[$file])) {

我正在添加文章视图中进行以下调用

...
echo $form->input('main_image', array('type' => 'file'));
...

我在添加操作中使用了以下内容,但它返回 false

...
if (!empty($this->data)) {
    //This call is not successful which skips to the }else{ display the message below
    if ($data = $this->Uploader->upload('main_image')) {
        // Upload successful, do whatever
    }else{
            $this->setFlash('Uploader Error',true);
    }
}
...

任何人都可以阐明什么可能是错误的。


** 编辑 **


我现在无法尝试这个,但我需要执行以下操作才能让它工作:

if ($data = $this->Uploader->upload(data['Article']['main_image'])) {

谢谢,

【问题讨论】:

    标签: cakephp plugins uploader


    【解决方案1】:

    花了很多时间试图弄清楚为什么它不起作用。最后我放弃了昨晚的尝试,决定尝试配置 CakePHP 的媒体插件。现在效果很好。设置轻而易举。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多