]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-231] добавляет слеш в корень пути для присоединения к алиасу
authorAlexander Smirnov <fredeom@mail.ru>
Mon, 28 Oct 2024 13:34:19 +0000 (16:34 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Mon, 28 Oct 2024 13:34:19 +0000 (16:34 +0300)
erp24/actions/files/DownloadAction.php

index 8084e936713961cac0e4235f00d2ad0c38c5bf33..9f769eb3369301cca73a1223c030ca0a6e4b58a1 100755 (executable)
@@ -4,13 +4,13 @@ namespace yii_app\actions\files;
 
 use Yii;
 use yii\base\Action;
+use yii_app\services\FileService;
 
 class DownloadAction extends Action
 {
     public function run($url)
     {
-        $filepath = \Yii::getalias('@yii_app') . $url;
-//        $filepath = \Yii::getalias('@webroot') . DIRECTORY_SEPARATOR . $url;
+        $filepath = \Yii::getalias('@yii_app') . FileService::padWithSlash($url);
         return \Yii::$app->response->sendFile($filepath);
     }
 }
\ No newline at end of file