I am trying to upload multiple files which is working perfectly. Whenever I am trying to update(CRUD) everything gets reset. I have tried with comment in
http://www.yiiframework.com/wiki/2/
Still I am unable to solve the problem. This is my code
if(isset($_POST['documents']))
{
// $valid=true;
foreach($doc as $i=>$pqr)
{
if(!empty($_POST['documents'][$i]))
{
$doc[$i]->attributes=$_POST['documents'][$i];
//$photosEvent[$i]->photoUrl = CUploadedFile::getInstance($photosEvent[$i], "photoUrl[$i]" );
$doc[$i]->document = CUploadedFile::getInstance($doc[$i], "document[$i]" );
if ( (is_object($file_flyer) && get_class($file_flyer)==='CUploadedFile'))
$doc[$i]->document = $file_flyer;
$doc[$i]->doc_link_id = $abc->document;
$doc[$i]->student_id = $_GET['id'];
if($doc[$i]->save(false))
{
if (is_object($file_flyer))
$doc[$i]->document->saveAs(Yii::app()->basePath.'/images/'.$doc[$i]->document);
}
}