title: Download link from Database BLOB with yii Framework
body: <p>I'm totaly new to the Yii Framework and i don't understand the how to create a download link with a popup window that asks if you whant to save the file.</p>
  
  <p>What i know and have till now:</p>
  
  <ol>
  <li>I know how the CHtml::link(...) works and already impelemted that. </li>
  <li>I extracted the Blob content form the db and saved it in a $data->file</li>
  <li>The link where i whant to click should be inside a CListView</li>
  </ol>
  
  <p>My database USERZ looks like this </p>
  
  <pre><code>+---------+-------------+------+-----+---------+----------------+
  | Field   | Type        | Null | Key | Default | Extra          |
  +---------+-------------+------+-----+---------+----------------+
  | id      | int(11)     | NO   | PRI | NULL    | auto_increment |
  | file    | blob        | NO   |     | NULL    |                |
  | USER_id | int(11)     | NO   | MUL | NULL    |                |
  | zname   | varchar(40) | NO   |     | NULL    |                |
  | date    | date        | NO   |     | NULL    |                |
  +---------+-------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>my Controller funktion (SiteController.php)</p>
  
  <pre><code>public function actionVerwal()
  {
      $model2=new USERZ;
      $this-&gt;render('verwal',array('model2'=&gt;$model2));
  
  }
  </code></pre>
  
  <p>and the view (verwal.php)</p>
  
  <pre><code>&lt;?php
   $this-&gt;widget('zii.widgets.CListView', array(
      'dataProvider'=&gt;$model2-&gt;a(Yii::app()-&gt;user-&gt;getId()),
      'itemView'=&gt;'_verwal',
  ));
  </code></pre>
  
  <p>//function a($id) just makes sure that the right user data is provided</p>
  
  <p>The Part that i dont understand (_verwal.php):</p>
  
  <pre><code>&lt;b&gt;&lt;?php echo CHtml::encode($data-&gt;getAttributeLabel('Files')); ?&gt;:&lt;/b&gt;
  &lt;?php echo CHtml::link(CHtml::encode($data-&gt;zname), $data-&gt;file); ?&gt;
  &lt;br /&gt;
  </code></pre>
  
  <p>How can i make the File name into a Link so it provides a download. I have all it needs the Content of the File and the Name but i dont know how to put them together and make them into 1 download file popup.</p>