Not work CMultiFileUpload

hi

i use CMultiFileUpload but return null in controller




$form = $this->beginWidget('CActiveForm', array(

                'id' => 'news-form',

		'enableAjaxValidation'=>false,

		'htmlOptions' => array('enctype' => 'multipart/form-data'),

    ));

.........

.........

$this->widget('CMultiFileUpload', array(

                'model'=>new news(),

                'attribute' => 'image',

                'name' => 'image',

                'accept'=>'jpg|gif|png|doc|docx|pdf',

                'denied'=>'Only doc,docx,pdf and txt are allowed', 

                'max'=>4,

                'remove'=>'[x]',

                'duplicate'=>'Already Selected',

            ));



in news/actionCreate




$model = new News();

        if(isset($_POST['News']))

        {

            

            echo Yii::app()->basePath.'/Images/';

            $images = CUploadedFile::getInstances($model,'image');

            echo '<br><br><br><br>';

            var_dump($images);

            echo '<br><br><br><br>';

            var_dump($_FILES);

            echo '<br><br><br><br>';

            var_dump($_POST);

            echo '<br><br><br><br>';

            var_dump(CUploadedFile::getInstancesByName('image'));

}



but All var_dump return “array(0){}” and There is not ‘image’ in $_POST[‘News’]

this roles in news model for image attributes




array('image', 'safe'),



Hi,

The code below also returns an empty array?


$images = CUploadedFile::getInstancesByName('News[image]');