How to overwrite an attribute


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?




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

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





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!