public function actionCreate()
{
$model=new Add;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['yt0']))
{
//$rnd = rand(0,9999); // generate random number between 0-9999
$model->attributes=$_POST['Add'];
$uploadedFile=CUploadedFile::getInstance($model,'add_videolink');
//$fileName = "{$rnd}-{$upenter code hereloadedFile}"; // random number + file name
$model->add_videolink = $uploadedFile;
// var_dump($model->save());exit();
if($model->save())
{
if(!empty($uploadedFile))
{
$uploadedFile->saveAs(Yii::app()->basePath.'/../images/Uploads'.$fileName);
}
$this->redirect(array('admin'));
}
}
$this->render('create',array(
'model'=>$model,
));
}
And when i tried to run this code it displays "move_uploaded_file():" The second argument to copy() function cannot be a directory'