开发者

CakePHP - Miles Uploader Plugin - Isset Error

I have tried several CakePHP file uploaders, but have not been successful' in setting up and making it work. I've settled down with Miles Uploader Plugin and I am doing everything I can to make it work. Installation instructions are excellent and I have followed them to the letter, but I still cant get it to work.

When I post an Article I get the following error:

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

I am making the following call in my add articles view

...
echo $form->i开发者_运维百科nput('main_image', array('type' => 'file'));
...

And I am using the following in my add action but it is returning 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);
    }
}
...

Can anyone please shed some light on what could possibly be wrong.


** EDIT **


I am not able to try this out right now, but do I need to do the following to make it work:

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

Thanks,


Spent many hours trying to figure out why it does not work. Finally I gave up last night trying and settled with trying to configure CakePHP's Media Plugin. That now works great. Setup was a breeze.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜