How to overwrite an attribute

Hi,

i tried to overwrite some attribute after the form sent…

I can overwrite attributes from the CHtml::activeTextField,

but not from the CHtml::activeFileField

do you know why?




if(isset($_POST['users']))

{

   $users->attributes=$_POST['users'];


   $users->description='test desc'; //TEXT FIELD - this attribute can I overwrite

   $users->photo=some_other_file_field //FILE FIELD - and this not


   if($users->save()){

      $this->redirect(array('admin'));

   }

}



Is there an error message? Normally there is no difference between text field and an file upload file. If you want to retrieve the file the user uploaded you need to use CUploadedFile. Just assigning the name to the model attribute does not retrieve the file from the tmp directory and manually changing the name either.

That is where I was wrong!

Thanks!