skeeks\cms\controllers\AdminStorageFilesController::actionDownload PHP Method

actionDownload() public method

public actionDownload ( )
    public function actionDownload()
    {
        \Yii::$app->response->format = Response::FORMAT_JSON;
        $success = false;
        /**
         * @var StorageFile $file
         */
        $file = $this->model;
        $file->src;
        header('Content-type: ' . $file->mime_type);
        header('Content-Disposition: attachment; filename="' . $file->cluster_file . '"');
        echo file_get_contents($file->cluster->getAbsoluteUrl($file->cluster_file));
        die;
    }