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!