CHttpException

The requested page does not exist.

/home/bbhos/domains/bbhos.com/public_html/protected/controllers/SiteController.php(133)

121      * Logs out the current user and redirect to homepage.
122      */
123     public function actionLogout()
124     {
125         Yii::app()->user->logout();
126         $this->redirect(Yii::app()->homeUrl);
127     }
128 
129     public function actionAttr($id)
130     {
131         $model = Attachment::model()->findByPk($id);
132         if ($model === null)
133             throw new CHttpException(404, 'The requested page does not exist.');
134 
135         $path = Yii::app()->basePath . "/../attachments";
136 
137         $file_path = $path . '/' . $model->a_filename;
138 
139         if (!file_exists($file_path))
140             throw new CHttpException(404, 'The requested page does not exist.');
141 
142         $filename = $model->a_name . '.' . $model->a_type;
143         header("Content-Type: " . $this->getMimeType($file_path));
144         header("Content-Transfer-Encoding: Binary");
145         header("Content-disposition: attachment; filename=\"" . $filename . "\"");

Stack Trace

#9
+
 /home/bbhos/domains/bbhos.com/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-29 13:42:35 Apache/2 Yii Framework/1.1.21