Yii CUploadedFile::getInstance returns NULL
check that when you created the form you passed the option
beginWidget('CActiveForm',array(
'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>
This determines how the form data is encoded when it is sent to the server. Usually there is no need to set the enctype attribute, the data is understood correctly on the server side anyway. However, if you are using a field for uploading a file (input type="file"), you should set the enctype attribute to multipart/form-data.
Comments