title: Undefined index in YII
body: <p>I am a newbie to YII. I don't know if this que might be too silly, but I am unable to figure it out.</p>
  
  <p>I have a view with basic fields and a browse button to upload files. 
  I have written the required rules in models too.</p>
  
  <p>view-</p>
  
  <pre><code>&lt;?php $form=$this-&gt;beginWidget('CActiveForm', array(
  'id'=&gt;'contact-form',
  'htmlOptions' =&gt; array('enctype' =&gt; 'multipart/form-data'),
  )); 
  ?&gt;
  &lt;?php echo $form-&gt;fileField($model, 'filename');?&gt;  //filename is defined here
  &lt;?php  echo $form-&gt;error($model, 'filename');?
  </code></pre>
  
  <p>controller- <br></p>
  
  <pre><code>$model=new ContactForm;
  if(isset($_POST['ContactForm']))
  {
  $model-&gt;attributes=$_POST['ContactForm'];
  if($model-&gt;validate())
  {
      // Some code;
   var_dump($_FILES['filename']); /**ERROR HERE**/
  }
  }
  </code></pre>
  
  <p>I have defined "filename" in view,model and controller. Yet, it displays error as "undefined index". If the problem is with redirecting it correctly, then why am I able to correctly dump other fields in my page? The problem is only with one field. Please help me find out my mistake.</p>