PHP notice

file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory

/home/1223734.cloudwaysapps.com/rpamfzuxzw/public_html/releases/20180313082839/protected/controllers/ReferenceController.php(1770)

1758 
1759         return Yii::app()->db->createCommand( $sql )->queryAll();
1760     }
1761 
1762     public function actionDownload( $id )
1763     {
1764         $model=$this->loadModel( $id );
1765 
1766         $path_to_file = Yii::getPathOfAlias('uploads') . '/reference/' . $model->link_to_pdf;
1767 
1768         if ( file_exists( $path_to_file ) )
1769         {
1770             $contents = file_get_contents( $path_to_file );
1771             Yii::app()->request->sendFile( $model->link_to_pdf, $contents );
1772         } else {
1773             throw new CHttpException(404,'The requested page does not exist.');
1774         }
1775     }
1776 
1777     public function actionPdf( $id ) {
1778         $model=$this->loadModel( $id );
1779         $path_to_file = Yii::getPathOfAlias('uploads') . '/reference/' . $model->link_to_pdf;
1780 
1781         if ( file_exists( $path_to_file ) ) {
1782             header('Content-Type: application/pdf');

Stack Trace

#0
+
 /home/1223734.cloudwaysapps.com/rpamfzuxzw/public_html/releases/20180313082839/protected/controllers/ReferenceController.php(1770): file_get_contents("/home/1223734.cloudwaysapps.com/rpamfzuxzw/public_html/releases/...")
1765 
1766         $path_to_file = Yii::getPathOfAlias('uploads') . '/reference/' . $model->link_to_pdf;
1767 
1768         if ( file_exists( $path_to_file ) )
1769         {
1770             $contents = file_get_contents( $path_to_file );
1771             Yii::app()->request->sendFile( $model->link_to_pdf, $contents );
1772         } else {
1773             throw new CHttpException(404,'The requested page does not exist.');
1774         }
1775     }
#15
+
 /home/1223734.cloudwaysapps.com/rpamfzuxzw/public_html/releases/20180313082839/index.php(12): CApplication->run()
07 defined('YII_DEBUG') or define('YII_DEBUG',true);
08 // specify how many levels of call stack should be shown in each log message
09 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
10 
11 require_once($yii);
12 Yii::createWebApplication($config)->run();
2024-03-28 15:51:25 Apache/2.4.57 (Debian) Yii Framework/1.1.13