title: HTTP Error: 500 uploadify-widget for yii framework
body: <p>I'm using <a href="https://github.com/yiiext/uploadify-widget" rel="nofollow">https://github.com/yiiext/uploadify-widget</a> , and i spend a lot of time trying to solve error HTTP Error: 500  , and i have no ideia how to debug</p>
  
  <p>here is view <code>protected/views/admin/_form_photo.php</code> :</p>
  
  <pre><code>&lt;?php
  $this-&gt;widget('ext.uploadify.EUploadifyWidget', array(
      // you can either use it for model attribute
      'model' =&gt; new UploadifyFile,
      'attribute' =&gt; 'file1',
      // or just for input field
      'name' =&gt; 'UploadifyFile_file1',
      // the name of the POST parameter where save session id
      'sessionParam' =&gt; 'PHP_SESSION_ID',
      // extension [options](http://www.uploadify.com/documentation/)
      'options' =&gt; array(
          'fileExt' =&gt; '*.jpg;*.png;*.gif',
          'script' =&gt; $this-&gt;createUrl('SwfUpload'),
          'debug' =&gt; true,
          'auto' =&gt; false,
          'multi' =&gt; true,
          'buttonText' =&gt; 'Upload Images',
          'onError' =&gt; 'js:function (event,ID,fileObj,errorObj) { alert(errorObj.type + \' Error: \' + errorObj.info); }'
      )
  ));
  ?&gt;
  </code></pre>
  
  <p>i have model  <code>protected/models/UploadifyFile.php</code> :</p>
  
  <pre><code>&lt;?php
  
  class UploadifyFile extends CFormModel
  {
      public $uploadifyFile;
  
      public function rules()
      {
          return array(
              array(
                  'uploadifyFile',
                  'file',
                  'maxSize' =&gt; 1024 * 1024 * 1024,
                  'types' =&gt; 'jpg, png, gif, txt'
              )
          );
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>i have action  <code>protected/controllers/SwfUploadAction.php</code> :</p>
  
  <pre><code>&lt;?php
      class SwfUploadAction extends CAction
      {
          public $folder;
  
          public function run()
          {
              $folder = $this-&gt;folder;
  
              if ($folder === false) {
                  throw new CException(Yii::t(__CLASS__, "Folder does not exists.", array()));
              }
              if (isset($_FILES['UploadifyFile']) === true) {
                  $model                = new UploadifyFile;
                  $model-&gt;attributes    = array(
                      'uploadifyFile' =&gt; ''
                  );
                  $model-&gt;uploadifyFile = CUploadedFile::getInstance($model, 'uploadifyFile');
                  if ($model-&gt;validate() === false) {
                      throw new CException(Yii::t(__CLASS__, "Invalid file.", array()));
                  }
                  if (!$model-&gt;uploadifyFile-&gt;saveAs($folder . '/' . $model-&gt;uploadifyFile-&gt;getName())) {
                      throw new CException(Yii::t(__CLASS__, "Upload error.", array()));
                  } else {
                      die("Upload success");
                  }
              } else {
                  throw new CException(Yii::t(__CLASS__, "File not sent.", array()));
              }
              throw new CException(Yii::t(__CLASS__, 'Unknown error.', array()));
          }
      }
  
      ?&gt;
  </code></pre>
  
  <p>and actions from controller  <code>protected/controllers/AdminController.php</code> :</p>
  
  <pre><code>function actions()
  {
      return array(
          'SwfUpload' =&gt; array(
              'class' =&gt; 'application.controllers.SwfUploadAction',
              'folder' =&gt; 'images'
          )
      );
  }
  </code></pre>
  
  <p>I read articles that , can be problems with authentication of flash  , and i have to use forgerySession <a href="http://code.google.com/p/yiiext/source/browse/trunk/app/extensions/yiiext/filters/forgerySession/" rel="nofollow">http://code.google.com/p/yiiext/source/browse/trunk/app/extensions/yiiext/filters/forgerySession/</a>  , and i have no idea how to configure it , A Big Thanks in advance !!!!</p>