title: Yii file field posting empty values
body: <p>I am a newbie in Yii, and I am trying to make an upload form in Yii, Please i need help.</p>
  
  <p>Once the form post data to the controller every other post value is posted except for the file value.
  i even tried checking for Errors with <code>var_dump($model-&gt;image);</code> and it returned this Error         <code>string '' (length=0)</code> specifying an empty string like an image wasn't even posted at all.</p>
  
  <p>This is my controller</p>
  
  <pre><code> class TestController extends Controller
      {
  
  public function actionIndex()
      {
          $model=new Test;
          if(isset($_POST['Test']))
          { 
              $model-&gt;attributes=$_POST['Test'];
  
                     if($model-&gt;save()){
                         var_dump($model-&gt;getErrors());
  
                     if ($model-&gt;image){
                            var_dump($model-&gt;image);
                           $uploadedFile=CUploadedFile::getInstance($model,'image');
                           $fileName = date("Y_m_d_H_i_s").$uploadedFile;
                           $model-&gt;image = $fileName;
                           if(!empty($uploadedFile))  // check if uploaded file is set or not
                           {
                             $uploadedFile-&gt;saveAs(Yii::getPathOfAlias('webroot').'/imagefolder/'.$fileName);
                           }
                     }
            }
  
           }
  
      }
  
  }
  </code></pre>
  
  <p>And this is my View</p>
  
  <pre><code>    &lt;?php $form=$this-&gt;beginWidget('CActiveForm', array(
      'id'=&gt;'test-form',
      'htmlOptions' =&gt; array('enctype' =&gt; 'multipart/form-data'),
      'enableAjaxValidation'=&gt;false,
  )); ?&gt; 
  
  &lt;?php echo CHtml::activeFileField($model,'image',array('id'=&gt;'primaryupload')); ?&gt;
  
  &lt;?php echo CHtml::submitButton($model-&gt;isNewRecord ? 'UPLOAD' : 'UPLOAD',array('id'=&gt;'submit','class'=&gt;'btn')); ?&gt;
  
  &lt;?php $this-&gt;endWidget(); ?&gt;
  </code></pre>
  
  <p>Any help will be appreciated. Because i am really frusrated at this point.</p>