Filefieldrow And Validation Don't Work

Hello,

i use :


<?php echo $form->fileFieldRow($model,'cours_source',array('tabIndex'=>3,)); ?>

controller:




...

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

               

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

                if($model->save()) {

                    if ($model->cours_source !== null){

                        $model->cours_source->saveAs(Yii::app()->params['qyiiPathStorage']);

                    }

                    if ($model->cours_pdf !== null){

                        $model->cours_pdf->saveAs(Yii::app()->params['qyiiPathStorage']);

                    }

...



model




return array(

			array('fk_formation_id, version, commentaire', 'required'),

            array('cours_source', 'file', 'types'=>'txt','allowEmpty'=>false,),

            array('cours_pdf', 'file', 'allowEmpty'=>false,'types'=>'pdf'),

			array('is_actif', 'numerical', 'integerOnly'=>true),

			array('cours_source, cours_pdf, cours_url', 'length', 'max'=>255),

			array('version', 'length', 'max'=>25),

			  array('cours_source,cours_pdf', 'safe'),

			// The following rule is used by search().

			// Please remove those attributes that should not be searched.

			array('fk_formation_id, is_actif, freeSearch', 'safe', 'on'=>'search'),

		);



The model summry tell me that I Have to choose a file even If I choosed one !

Any ideas?

Thank

NAth

nobody ?

I look in the web for hours, I don’t find solution… :wacko: