yii xupload extension

Hi

i am new to yii development framework. i use the yii XUploa extension for uploading images the integration of extension with application is successfull but when click on addfiles the file added when click on start upload the exception error come like Error SyntaxError: Unexpected token < and file does not uplaoded

can any one knows about this then plz reply

thanks

Hi,

I had the same problem, fixed this once i logged in. Be sure you have the "upload" action in accessRules method. Hope this helps.

Thanx for advice, but problem still exists. Could you tell please, where do you place your accessRules() method with "upload" rule?

Also, maybe you have changed another files as well?

Hi,

You should place the rule "upload" in the accessRules(), in the same controller where you have the actionUpload():




<?php


Yii::import("xupload.models.XUploadForm");


class GalleryController extends CController {




public function accessRules() {

        return array(

            array('allow', // allow all users to perform 'index' and 'view' actions

                'actions' => array('index', 'view'),

                'users' => array('*'),

            ),

            array('allow', // allow authenticated user to perform 'create' and 'update' actions

                'actions' => array('create', 'update', 'upload'),

                'users' => array('@'),

            ),

            array('allow', // allow admin user to perform 'admin' and 'delete' actions

                'actions' => array('admin', 'delete', 'upload'),

                'users' => array('admin'),

            ),

            array('deny', // deny all users

                'users' => array('*'),

            ),

        );

    }





public function actionUpload() {

        return array(

            'upload' => array(

                'class' => 'xupload.actions.XUploadAction',

                'path' => Yii::app()->getBasePath() . "/../upload/albums",

                'publicPath' => Yii::app()->getBaseUrl() . "/upload/albums",

                'subfolderVar' => 'parent_id',

            ),

        );

    }

}






Hope it helps.

Sorry, but array you have in ‘actionUpload’ is in ‘actions’ method in my fileManager controller. Why do you have to do so? Maybe your variant is more flexible?

It looks like you have used ‘gii’ module to construct CRUD for extension, am I right?

I use module and controller default templates. Could you show me your extension files and how you integrated it?

[color="#006400"]/* Moved from General Discussion to Extensions … */[/color]

Ok, figured out. Thanx for help.