PHP warning

fopen(assets/files/words/file-1510467733855.pdf): failed to open stream: No such file or directory

/home/havailam/public_html/protected/controllers/SiteController.php(314)

302     }
303 
304     public function actiondownload()
305     {
306         ignore_user_abort(true);
307         set_time_limit(0); // disable the time limit for this script
308 
309         $path = UserFileAdministration::File_DIRECTORY_ADDRESS; // change the path to fit your websites document structure
310         $dl_file = preg_replace("([^\w\s\d\-_~,;:\[\]\(\].]|[\.]{2,})", '', $_GET['file']); // simple file name validation
311         $dl_file = filter_var($dl_file, FILTER_SANITIZE_URL); // Remove (more) invalid characters
312         $fullPath = $path . $dl_file;
313 
314         if ($fd = fopen($fullPath, "r")) {
315             $fsize = filesize($fullPath);
316             $path_parts = pathinfo($fullPath);
317             $ext = strtolower($path_parts["extension"]);
318             switch ($ext) {
319                 case "pdf":
320                     header("Content-type: application/pdf");
321                     header("Content-Disposition: attachment; filename=\"" . $path_parts["basename"] . "\""); // use 'attachment' to force a file download
322                     break;
323                 // add more headers for other content types here
324                 default;
325                     header("Content-type: application/octet-stream");
326                     header("Content-Disposition: filename=\"" . $path_parts["basename"] . "\"");

Stack Trace

#0
+
 /home/havailam/public_html/protected/controllers/SiteController.php(314): fopen("assets/files/words/file-1510467733855.pdf", "r")
309         $path = UserFileAdministration::File_DIRECTORY_ADDRESS; // change the path to fit your websites document structure
310         $dl_file = preg_replace("([^\w\s\d\-_~,;:\[\]\(\].]|[\.]{2,})", '', $_GET['file']); // simple file name validation
311         $dl_file = filter_var($dl_file, FILTER_SANITIZE_URL); // Remove (more) invalid characters
312         $fullPath = $path . $dl_file;
313 
314         if ($fd = fopen($fullPath, "r")) {
315             $fsize = filesize($fullPath);
316             $path_parts = pathinfo($fullPath);
317             $ext = strtolower($path_parts["extension"]);
318             switch ($ext) {
319                 case "pdf":
#8
+
 /home/havailam/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-04-18 16:44:38 LiteSpeed Yii Framework/1.1.15