use Multiplefileupload to replace CFileUpload

I am interested in using multiplefileupload to replace cfileupload…

But I really have no idea how…

I simply add


<?php echo CHtml::activeFileField($model, 'file',[u][b]array('multiple' => true)[/b][/u]); ?>

But it not works…

What should I do in my controller? any hints?

Here is my actionCreate…




                       $model->file=CUploadedFile::getInstance($model,'file');

			if($model->save())

                        {     

                      $fileSavePath = xxxxxxxxx;

                     if (!file_exists ($fileSavePath)){

                    mkdir ($fileSavePath, 0777, true);

                        }


			       $model->file->saveAs(xxxxxxxx); 

                               $path=xxxxxxxxxx;


                               $filename=$model->file;

                               $model ->path = $path;

                               $model ->filename =$filename;

                               $model ->save();

                               $this->redirect(array('view','id'=>$model->id));

                         }                                                                   

		}



Any help would be very helpful…

Thanks in advance!

Try something like:




$files = CUploadedFile::getInstance($model,'file');

foreach ($files as file)

{

$file->saveAs(Yii::getPathOfAlias('path/[size=2]xxx[/size]').'/'.$file->getName());

}



obviously, in the view, mult inputs would be available, using CHtml