title: Yii framework failed to open stream
body: <p>I am using Yii framework and I want to create user registration page. Everything seems to work fine but when i want to upload user image, I get an error message:</p>
  
  <pre><code>include(Self.php) [&lt;a href='function.include'&gt;function.include&lt;/a&gt;]: failed to open stream: No such file or directory
  </code></pre>
  
  <p>Here is my SiteController code:</p>
  
  <pre><code>public function actionRegister()
  {
      $model=new RegisterForm;
  
      // uncomment the following code to enable ajax-based validation
  
      if(isset($_POST['ajax']) &amp;&amp; $_POST['ajax']==='register-form')
      {
          echo CActiveForm::validate($model);
          Yii::app()-&gt;end();
      }
  
      if(isset($_POST['RegisterForm']))
      {
          $model-&gt;attributes=$_POST['RegisterForm'];
          if($model-&gt;validate())
          {
              $user = new User;
              $user-&gt;username = $_POST['RegisterForm']['username'];
              $password = $_POST['RegisterForm']['password'];
              $salt = Security::GenerateSalt(128);
              $user-&gt;password = hash('sha512', $password.$salt);
              $user-&gt;question = $_POST['RegisterForm']['question'];
              $user-&gt;answer = $_POST['RegisterForm']['answer'];
              $user-&gt;salt = $salt;
              $user-&gt;email = $_POST['RegisterForm']['email'];
              $user-&gt;fullname = $_POST['RegisterForm']['fullname'];
              $user-&gt;birth = $_POST['RegisterForm']['birth'];
              $user-&gt;avatar = CUploadedFile::getInstance($model,'image');
              $user-&gt;avatar-&gt;saveAs('/images/users.test.jpg');
              $user-&gt;about = $_POST['RegisterForm']['about'];
              $user-&gt;signup = date('d/m/y');
              $user-&gt;login = date('d/m/y');
              $user-&gt;save();
          }
      }
      $this-&gt;render('register',array('model'=&gt;$model));
  }
  </code></pre>
  
  <p>Here is my RegisterForm model code:</p>
  
  <pre><code>&lt;?php
  class RegisterForm extends CFormModel
  {
  [.....]
  
   public $avatar;
  
  [.....]
  
      public function rules()
      {
          return array( 
  
  [......]
  
              array('avatar', 'file', 
                                  'types'=&gt;'jpg, gif, png', 
                                  'maxSize'=&gt;1024 * 1024 * 2,
                                  'tooLarge'=&gt;'The file was larger than 2MB. Please upload a smaller file.',
                                  'wrongType'=&gt;'Please upload only images in the format jpg, gif, png',
                                  'tooMany'=&gt;'You can upload only 1 avatar',
                          'on'=&gt;'upload'),
  
  [......]
  
  }
  </code></pre>
  
  <p>The view:</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'avatar'); ?&gt;
      &lt;?php echo CHtml::activeFileField($model, 'avatar'); ?&gt;
      &lt;?php echo $form-&gt;error($model,'avatar'); ?&gt;
  &lt;/div&gt;
  </code></pre>